139140141142143144145146147148149
// Ensure that data is read using the proper endianness! stream.setByteOrder(ByteOrder.BIG_ENDIAN); try { int index = 4; stream.seek(index); byte[] markerBytes = new byte[2]; while(true) { index += stream.readUnsignedShort(); stream.seek(index);
144145146147148149150151152153154
stream.seek(index); byte[] markerBytes = new byte[2]; while(true) { index += stream.readUnsignedShort(); stream.seek(index); stream.read(markerBytes); index += 2; // Frame header?