Protocol { static void writeBlobString(RedisOutputStream stream, byte[] value) throws IOException { stream.write(BLOB_STRING_BYTE); stream.writeBytesCRLF(RedisEncodings.encode(value.length)); stream.writeBytesCRLF(value); }    }
@Test void writeBlobString() throws IOException { var stream = new ByteArrayOutputStream(); var outputStream = new RedisOutputStream(stream, 8192); Protocol.writeBlobString(outputStream, encode("value")); outputStream.flush(); assertThat(decode(stream.toByteArray())).isEqualTo("$5\r\nvalue\r\n"); }