}
//Read the size field (as Big Endian Int - byte buffers always initialised to Big Endian order)
frameSize = byteBuffer.getInt();
if (frameSize < 0) {
//logger.warning(getLoggingFilename() + ":Invalid Frame Size:" + identifier);
throw new InvalidFrameException(identifier + " is invalid frame");
} else if (frameSize == 0) {
//logger.warning(getLoggingFilename() + ":Empty Frame Size:" + identifier);
//We don't process this frame or add to frameMap because contains no useful information
//Skip the two flag bytes so in correct position for subsequent frames
byteBuffer.get();
byteBuffer.get();
throw new EmptyFrameException(identifier + " is empty frame");
} else if (frameSize > byteBuffer.remaining()) {
//logger.warning(getLoggingFilename() + ":Invalid Frame size of " + frameSize + " larger than size of" + byteBuffer.remaining() + " before mp3 audio:" + identifier);
throw new InvalidFrameException(identifier + " is invalid frame");
}
//Read the flag bytes
statusFlags = new StatusFlags(byteBuffer.get());
encodingFlags = new EncodingFlags(byteBuffer.get());