Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TBinaryProtocol.writeI32()


        TBinaryProtocol protocol = new TBinaryProtocol( transport );

        int messageLength, headerLength;

        protocol.writeI16( ThriftCodec.MAGIC );
        protocol.writeI32( Integer.MAX_VALUE );
        protocol.writeI16( Short.MAX_VALUE );
        protocol.writeByte( ThriftCodec.VERSION );
        protocol.writeString(
                ( ( RpcInvocation ) request.getData() )
                        .getAttachment( Constants.INTERFACE_KEY) );
View Full Code Here


        try{
            bos.setWriteIndex( ThriftCodec.MESSAGE_HEADER_LENGTH_INDEX );
            protocol.writeI16( ( short ) ( 0xffff & headerLength ) );
            bos.setWriteIndex( ThriftCodec.MESSAGE_LENGTH_INDEX );
            protocol.writeI32( messageLength );
        } finally {
            bos.setWriteIndex( oldIndex );
        }

        Object obj = codec.decode( ( Channel ) null, ChannelBuffers.wrappedBuffer(
View Full Code Here

        TBinaryProtocol protocol = new TBinaryProtocol( transport );

        int messageLength, headerLength;
        // prepare
        protocol.writeI16( ThriftCodec.MAGIC );
        protocol.writeI32( Integer.MAX_VALUE );
        protocol.writeI16( Short.MAX_VALUE );
        protocol.writeByte( ThriftCodec.VERSION );
        protocol.writeString( Demo.Iface.class.getName() );
        protocol.writeI64( request.getId() );
        protocol.getTransport().flush();
View Full Code Here

        protocol.getTransport().flush();
        int oldIndex = messageLength = bos.size();

        try {
            bos.setWriteIndex( ThriftCodec.MESSAGE_LENGTH_INDEX );
            protocol.writeI32( messageLength );
            bos.setWriteIndex( ThriftCodec.MESSAGE_HEADER_LENGTH_INDEX );
            protocol.writeI16( ( short ) ( 0xffff & headerLength ) );
        } finally {
            bos.setWriteIndex( oldIndex );
        }
View Full Code Here

        TApplicationException exception = new TApplicationException();

        int messageLength, headerLength;
        // prepare
        protocol.writeI16( ThriftCodec.MAGIC );
        protocol.writeI32( Integer.MAX_VALUE );
        protocol.writeI16( Short.MAX_VALUE );
        protocol.writeByte( ThriftCodec.VERSION );
        protocol.writeString( Demo.class.getName() );
        protocol.writeI64( request.getId() );
        protocol.getTransport().flush();
View Full Code Here

        protocol.getTransport().flush();
        int oldIndex = messageLength = bos.size();

        try {
            bos.setWriteIndex( ThriftCodec.MESSAGE_LENGTH_INDEX );
            protocol.writeI32( messageLength );
            bos.setWriteIndex( ThriftCodec.MESSAGE_HEADER_LENGTH_INDEX );
            protocol.writeI16( ( short ) ( 0xffff & headerLength ) );
        } finally {
            bos.setWriteIndex( oldIndex );
        }
View Full Code Here

    private <T extends TTransport> T writeSecondChunk(T outTransport) throws TException
    {
        TProtocol outProtocol = new TBinaryProtocol(outTransport);

        outProtocol.writeI32(111);
        outProtocol.writeBinary(ByteBuffer.wrap(new byte[10]));

        return outTransport;
    }
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.