@Override
  public int read() throws IOException {
    if (!byteBuffer.hasRemaining()) {
      return -1;
    }
    return byteBuffer.get() & 0xFF;
  }
Reads 'size' amount of bytes from the stream into the buffer.
@param stream The stream from which bytes need to be read. If the underlying stream is SocketInputStream, it needs
              to be blocking.
@param size The size that needs to be read from the stream
@throws IOException
ambry-utils/src/main/java/com/github/ambry/utils/ByteBufferInputStream.java