Package io.netty.buffer

Examples of io.netty.buffer.ByteBufOutputStream.writeInt()


        final int length = in.readableBytes();
        final InputStream bbIn = new ByteBufInputStream(in);

        final ByteBufOutputStream bbOut = new ByteBufOutputStream(out);
        bbOut.writeByte(properties);
        bbOut.writeInt(littleEndianDictionarySize);
        bbOut.writeLong(Long.reverseBytes(length));
        encoder.code(bbIn, bbOut, -1, -1, null);

        bbIn.close();
        bbOut.close();
View Full Code Here


        final int length = in.readableBytes();
        final InputStream bbIn = new ByteBufInputStream(in);

        final ByteBufOutputStream bbOut = new ByteBufOutputStream(out);
        bbOut.writeByte(properties);
        bbOut.writeInt(littleEndianDictionarySize);
        bbOut.writeLong(Long.reverseBytes(length));
        encoder.code(bbIn, bbOut, -1, -1, null);

        bbIn.close();
        bbOut.close();
View Full Code Here

      buf = ctx.alloc().buffer(requestSize);
    }
    ByteBufOutputStream output = new ByteBufOutputStream(buf);

    // This will later be filled with the correct size of serialized request
    output.writeInt(0);
    output.writeByte(request.getType().ordinal());
    try {
      request.write(output);
    } catch (IndexOutOfBoundsException e) {
      LOG.error("write: Most likely the size of request was not properly " +
View Full Code Here

    if (LOG.isDebugEnabled()) {
      LOG.debug("encode: Encoding a message of type " + msg.getClass());
    }

    // Space is reserved now to be filled later by the serialize request size
    output.writeInt(0);
    // write type of object.
    output.writeByte(writableRequest.getType().ordinal());
    // write the object itself.
    writableRequest.write(output);
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.