RedisStreamWriter implements Closeable { public void writeNewLine() throws IOException { write(RedisBytes.CARRIAGE_RETURN_BYTE); write(RedisBytes.LINE_FEED_BYTE); } RedisStreamWriter(OutputStream outputStream); void flush(); void write(byte theByte); void write(int value); void writeNewLine(); void write(byte[] bytes); void write(final byte[] bytes, final int offset, final int length); @Override void close(); static final int BUFFER_SIZE; }
@Test public void writeNewLine() throws IOException { writer.writeNewLine(); assertEquals(writer.buffer[0], '\r'); assertEquals(writer.buffer[1], '\n'); }