public void align ( final long alignByteNumber ) throws IOException { this . alignByte ( ) ; if ( alignByteNumber > 0 ) { long padding = ( alignByteNumber - ( this . byteCounter % alignByteNumber ) ) % alignByteNumber ; while ( padding > 0 ) { final int skippedByte = this . read ( ) ; if ( skippedByte < 0 ) { throw new EOFException ( "Can't align for " + alignByteNumber + " byte(s)" ) ; } padding -- ; } } }
Read padding bytes from the stream and ignore them to align the stream counter .