When writing a negative sign the write(char) method goes directly to the output stream and by-passes the internal RedisOutputStream buffer causing random corruption of the output. Casting the char to a byte ensures write(byte) is called which will properly buffer the output.

This commit is contained in:
Darren Shepherd
2013-03-29 22:28:01 -07:00
parent 69f5340aa6
commit 5e2cdb9c08

View File

@@ -187,7 +187,7 @@ public final class RedisOutputStream extends FilterOutputStream {
public void writeIntCrLf(int value) throws IOException {
if (value < 0) {
write('-');
write((byte)'-');
value = -value;
}