code: private void fillTrailerBuffer() throws IOException {
      trailerBuffer = new byte[trailerSize];
  
      if (trailerSize == 0) {
        return;
      }
  
      int bytesRead = StreamUtils.readAllBytes(in, trailerBuffer);
      if (bytesRead != trailerBuffer.length) {
        throw new EOFException(String.format(
            "Trailer size was %d bytes but stream only contained %d bytes.",
            trailerSize, bytesRead));
      }
    }
docs: Populates the trailer buffer with data from the stream.
  
  @throws EOFException
  if the stream finishes before the trailer is read
  @throws IOException
  if the underlying stream throws an exception