code: @Override
    public int read() throws IOException {
      if (trailerBuffer == null) {
        fillTrailerBuffer();
      }
  
      int nextByte = in.read();
  
      if (nextByte == EOF_VALUE) {
        return nextByte;
      }
  
      if (trailerBuffer.length == 0) {
        return nextByte;
      }
  
      int result = trailerBuffer[0] & 0xFF; // must be positive
  
      System.arraycopy(trailerBuffer, 1, trailerBuffer, 0,
          trailerBuffer.length - 1);
      trailerBuffer[trailerBuffer.length - 1] = (byte) nextByte;
  
      return result;
    }
docs: Reads the next byte from the underlying {@code InputStream}. This method
  returns {@code -1} when the last byte before the trailer has been read.
  
  @return the next non-trailer byte from the underlying stream, or {@code -1}
  
  @throws EOFException
  if the stream contains less data than the size of the trailer
  @throws IOException
  if the underlying stream throws an exception