### Question:
DecodedStreamBuffer { public DecodedStreamBuffer(int maxBufferSize) { bufferArray = new byte[maxBufferSize]; this.maxBufferSize = maxBufferSize; } DecodedStreamBuffer(int maxBufferSize); void buffer(byte read); void buffer(byte[] array, int offset, int length); boolean hasNext(); byte next(); void startReadBuffer();  }### Answer:
@Test public void testDecodedStreamBufferTest() { byte[] toBuff = "0123456789".getBytes(StringUtils.UTF8); assertEquals(toBuff.length, 10); DecodedStreamBuffer buff = new DecodedStreamBuffer(10); assertFalse(buff.hasNext()); buff.buffer(toBuff[0]); buff.buffer(toBuff, 1, toBuff.length - 1); ByteArrayOutputStream baos = new ByteArrayOutputStream(); buff.startReadBuffer(); while (buff.hasNext()) { baos.write(buff.next()); } assertArrayEquals(toBuff, baos.toByteArray()); }