question: protected String readIdentifier ( ByteBuffer byteBuffer ) throws PaddingException , InvalidFrameException { byte [ ] buffer = new byte [ getFrameIdSize ( ) ] ; if ( byteBuffer . position ( ) + getFrameHeaderSize ( ) >= byteBuffer . limit ( ) ) { logger . warning ( getLoggingFilename ( ) + ":" + "No space to find another frame:" ) ; throw new InvalidFrameException ( getLoggingFilename ( ) + ":" + "No space to find another frame" ) ; } byteBuffer . get ( buffer , 0 , getFrameIdSize ( ) ) ; if ( isPadding ( buffer ) ) { throw new PaddingException ( getLoggingFilename ( ) + ":only padding found" ) ; } identifier = new String ( buffer ) ; logger . fine ( getLoggingFilename ( ) + ":" + "Identifier is" + identifier ) ; return identifier ; }
target:  Get the next frame id, throwing an exception if unable to do this and check against just having padded data