Fixed - Jackson 2.9 compatibility

pull/1300/head
Nikita 7 years ago
parent 2341fb1298
commit bb3807c6c9

@ -17,6 +17,7 @@ package org.redisson.client.codec;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder;
@ -52,7 +53,7 @@ public class JsonJacksonMapCodec extends JsonJacksonCodec {
ByteBuf out = ByteBufAllocator.DEFAULT.buffer();
try {
ByteBufOutputStream os = new ByteBufOutputStream(out);
mapper.writeValue(os, in);
mapper.writeValue((OutputStream)os, in);
return os.buffer();
} catch (IOException e) {
out.release();

@ -17,6 +17,7 @@ package org.redisson.codec;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.xml.datatype.XMLGregorianCalendar;
@ -72,7 +73,7 @@ public class JsonJacksonCodec implements Codec {
ByteBuf out = ByteBufAllocator.DEFAULT.buffer();
try {
ByteBufOutputStream os = new ByteBufOutputStream(out);
mapObjectMapper.writeValue(os, in);
mapObjectMapper.writeValue((OutputStream)os, in);
return os.buffer();
} catch (IOException e) {
out.release();

Loading…
Cancel
Save