Search in sources :

Example 1 with DecoderInputStream

use of org.adbcj.support.DecoderInputStream in project adbcj by mheath.

the class Encoder method decode.

@Override
protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
    InputStream in = new ChannelBufferInputStream(buffer);
    DecoderInputStream dis = new DecoderInputStream(in);
    try {
        return decoder.decode(dis, false);
    } finally {
        dis.close();
    }
}
Also used : DecoderInputStream(org.adbcj.support.DecoderInputStream) ChannelBufferInputStream(org.jboss.netty.buffer.ChannelBufferInputStream) InputStream(java.io.InputStream) ChannelBufferInputStream(org.jboss.netty.buffer.ChannelBufferInputStream) DecoderInputStream(org.adbcj.support.DecoderInputStream)

Aggregations

InputStream (java.io.InputStream)1 DecoderInputStream (org.adbcj.support.DecoderInputStream)1 ChannelBufferInputStream (org.jboss.netty.buffer.ChannelBufferInputStream)1