RedisOutputStream { void write(byte value) throws IOException { if (position == buffer.length) { flush(); } buffer[position++] = value; } RedisOutputStream(OutputStream stream, int bufferSize);   }
@Test void write() throws IOException { stream.write((byte) '1'); stream.write((byte) '2'); stream.write((byte) '3'); stream.write((byte) '4'); stream.write((byte) '5'); stream.flush(); assertEquals("12345", decode(output.toByteArray())); }