public long readStartCode() throws IOException {
    byte frameCode = in.readByte();
    if (frameCode != 'N') {
      return (long) (frameCode & 0xff);
    }

    // Otherwise read the remaining 64bit startCode
    byte[] buffer = new byte[8];
    buffer[0] = frameCode;
    readFully(buffer, 1, 7);
    return (((long) buffer[0] << 56)
        + ((long) (buffer[1] & 255) << 48)
        + ((long) (buffer[2] & 255) << 40)
        + ((long) (buffer[3] & 255) << 32)
        + ((long) (buffer[4] & 255) << 24)
        + ((buffer[5] & 255) << 16)
        + ((buffer[6] & 255) << 8)
        + ((buffer[7] & 255) << 0));
  }
public long readStartCode ( ) throws IOException { byte frameCode = in . readByte ( ) ; if ( frameCode != 'N' ) { return ( long ) ( frameCode & 0xff ) ; } byte [ ] buffer = new byte [ 8 ] ; buffer [ 0 ] = frameCode ; readFully ( buffer , 1 , 7 ) ; return ( ( ( long ) buffer [ 0 ] << 56 ) + ( ( long ) ( buffer [ 1 ] & 255 ) << 48 ) + ( ( long ) ( buffer [ 2 ] & 255 ) << 40 ) + ( ( long ) ( buffer [ 3 ] & 255 ) << 32 ) + ( ( long ) ( buffer [ 4 ] & 255 ) << 24 ) + ( ( buffer [ 5 ] & 255 ) << 16 ) + ( ( buffer [ 6 ] & 255 ) << 8 ) + ( ( buffer [ 7 ] & 255 ) << 0 ) ) ; }
Returns the start code, OR frame_code if the code doesn't start with 'N'