public byte[] readBytes() throws IOException {
    byte[] raw;
    try {
      final int start = currentPosition;
      final int nextFile = index.readUnsignedShort();
      currentPosition = index.readInt();
      if (nextFile == fileNumber) {
        final int len = currentPosition - start;
        raw = new byte[len];
        in.read(raw);
      } else {
        raw = new byte[(int) (in.length() - in.getFilePointer())];
        in.read(raw);
        in.close();
        fileNumber = nextFile;
        in = new RandomAccessFile(filenameGenerator.apply(fileNumber, compressed).toFile(), "r");
        if (currentPosition != 0) {
          in.seek(currentPosition);
        }
      }
    } catch (final EOFException e) {
      // this happens when we read the last value, where there is no next index.
      raw = new byte[(int) (in.length() - in.getFilePointer())];
      in.read(raw);
      done = true;
    }
    return compressed ? Snappy.uncompress(raw) : raw;
  }
Read bytes.

@return the byte [ ]
@throws IOException the io exception
util/src/main/java/org/hyperledger/besu/util/io/RollingFileReader.java