private void readByteByByteTest(byte[] in) throws Exception {
    // channel with size and one piece of content.
    ReadableStreamChannel channel = new ByteBufferReadableStreamChannel(ByteBuffer.wrap(in));
    InputStream stream = new ReadableStreamChannelInputStream(channel);
    doReadByteByByteTest(stream, in);
    stream.close();

    // channel with no size but one piece of content.
    channel = new NoSizeRSC(ByteBuffer.wrap(in));
    stream = new ReadableStreamChannelInputStream(channel);
    doReadByteByByteTest(stream, in);
    stream.close();

    // channel with no size and multiple pieces of content.
    List<ByteBuffer> contents = splitContent(in, CONTENT_SPLIT_PART_COUNT);
    contents.add(null);
    channel = new MockRestRequest(MockRestRequest.DUMMY_DATA, contents);
    stream = new ReadableStreamChannelInputStream(channel);
    doReadByteByByteTest(stream, in);
    stream.close();
  }
Tests reading {@link ReadableStreamChannelInputStream} byte by byte.
@param in the data that the {@link ReadableStreamChannelInputStream} should contain.
@throws Exception
ambry-commons/src/test/java/com/github/ambry/commons/ReadableStreamChannelInputStreamTest.java