Package io.netty.buffer

Examples of io.netty.buffer.ByteBuf.discardReadBytes()


                    final Serializable testResult = NettyServer.this.executeTest(archiveId, testClassName, methodName);

                    ObjectOutputStream objectOutstream = null;
                    try {
                        // Write the test result
                        out.discardReadBytes();
                        objectOutstream = new ObjectOutputStream(new ByteBufOutputStream(out));
                        objectOutstream.writeObject(testResult);
                        objectOutstream.flush();
                        ctx.flush();
                        return;
View Full Code Here


    @Override
    public void inboundBufferUpdated(final ChannelHandlerContext ctx,
            final ByteBuf in) {
        meter.mark(in.readableBytes());
        final ByteBuf out = ctx.nextOutboundByteBuffer();
        out.discardReadBytes();
        out.writeBytes(in);
        ctx.flush();
    }

    @Override
View Full Code Here

    @Override
    public void inboundBufferUpdated(final ChannelHandlerContext ctx,
            final ByteBuf in) {
        final ByteBuf out = ctx.nextOutboundByteBuffer();
        out.discardReadBytes();
        out.writeBytes(in);
        ctx.flush();
    }

    @Override
View Full Code Here

        ByteBuf frame = (ByteBuf) super.decode(ctx, in);
        if (frame == null) {
            throw new IOException("Received unexpected empty frame. Maybe you have enabled secure transmission on only one endpoint of the connection.");
        }
        byte type = frame.readByte();
        frame.discardReadBytes();
        String id = frame.toString(CharsetUtil.UTF_8);
        try {
            log.debug("received type {} with id {}", type, id);
            return RecordId.fromString(store.getTracker(), id);
        } catch (IllegalArgumentException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.