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:
@@ -187,7 +187,7 @@ public final class RedisOutputStream extends FilterOutputStream {
|
|||||||
|
|
||||||
public void writeIntCrLf(int value) throws IOException {
|
public void writeIntCrLf(int value) throws IOException {
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
write('-');
|
write((byte)'-');
|
||||||
value = -value;
|
value = -value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user