@Override
  public void readFully(byte[] b, int off, int len)
      throws EOFException {
    if (len < 0) {
      throw new IndexOutOfBoundsException("len is negative: " + len);
    }
    if (off < 0 || off + len > b.length) {
      throw new IndexOutOfBoundsException("off=" + off + ", len=" + len + ", b.length=" + b.length);
    }
    // the javadoc of DataInput.readFully(byte[], int, int) says that the method will block until the requested
    // number of bytes has been read, end of file is detected, or an exception is thrown.
    // So being formal, we should modify the buffer even if we know we are going to reach EOF.
    boolean eof = availableLong() < len;
    _dataBuffer.copyTo(_currentOffset, b, off, len);
    _currentOffset += len;
    if (eof) {
      throw new EOFException();
    }
  }
@Test
  void testReadFully()
      throws IOException {
    byte[] buffer = new byte[BUFFER_SIZE];
    _dataBufferPinotInputStream.readFully(buffer);

    for (int i = 0; i < BUFFER_SIZE; i++) {
      assertEquals(buffer[i], _byteBuffer.get(i));
    }
    assertEquals(_dataBufferPinotInputStream.getCurrentOffset(), BUFFER_SIZE);
  }