private boolean isABI ( ) { char ABI [ ] = new char [ 4 ] ; for ( int i = 0 ; i <= 2 ; i ++ ) { ABI [ i ] = ( char ) traceData [ i ] ; } if ( ABI [ 0 ] == ' ' && ( ABI [ 1 ] == ' ' && ABI [ 2 ] == ' ' ) ) { return true ; } else { for ( int i = 128 ; i <= 130 ; i ++ ) { ABI [ i - 128 ] = ( char ) traceData [ i ] ; } if ( ABI [ 0 ] == ' ' && ( ABI [ 1 ] == ' ' && ABI [ 2 ] == ' ' ) ) { macJunk = 128 ; return true ; } else return false ; } }
Test to see if the file is ABI format by checking to see that the first three bytes are ABI . Also handle the special case where 128 bytes were prepended to the file due to binary FTP from an older macintosh system .