public static byte[] readBytesFromByteBuf(ByteBuf buffer, byte[] data, int offset, int size) throws IOException {
    buffer.readBytes(data, offset, size);
    return data;
  }
Read "size" length of bytes from a netty {@link ByteBuf} to a byte array starting at the given offset in the byte[]. If "size"
length of bytes can't be read because the end of the buffer has been reached, IOException is thrown. This method
blocks until input data is available, the end of the buffer is detected, or an exception is thrown.
@param buffer from which data to be read from
@param data byte[] into which the data has to be written
@param offset starting offset in the byte[] at which the data has to be written to
@param size length of bytes to be read from the stream
@return byte[] which has the data that is read from the buffer. Same as @param data
@throws IOException
ambry-utils/src/main/java/com/github/ambry/utils/Utils.java