Decoder/Encoder throws IOException added

pull/243/head
Nikita 10 years ago
parent 6dcbf7c780
commit a347285e99

@ -15,10 +15,12 @@
*/
package org.redisson.client.protocol;
import java.io.IOException;
import io.netty.buffer.ByteBuf;
public interface Decoder<R> {
R decode(ByteBuf buf);
R decode(ByteBuf buf) throws IOException;
}

@ -15,8 +15,10 @@
*/
package org.redisson.client.protocol;
import java.io.IOException;
public interface Encoder {
byte[] encode(int paramIndex, Object in);
byte[] encode(int paramIndex, Object in) throws IOException;
}

@ -15,7 +15,7 @@
*/
package org.redisson.client.protocol;
import java.io.UnsupportedEncodingException;
import java.io.IOException;
import io.netty.buffer.ByteBuf;
import io.netty.util.CharsetUtil;
@ -41,12 +41,8 @@ public class StringCodec implements Codec {
public Encoder getValueEncoder() {
return new Encoder() {
@Override
public byte[] encode(int paramIndex, Object in) {
try {
return in.toString().getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException(e);
}
public byte[] encode(int paramIndex, Object in) throws IOException {
return in.toString().getBytes("UTF-8");
}
};
}

Loading…
Cancel
Save