Package org.apache.thrift.protocol

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


  }
 
  public static void testNakedI32(int n) throws Exception {
    TMemoryBuffer buf = new TMemoryBuffer(0);
    TProtocol proto = factory.getProtocol(buf);
    proto.writeI32(n);
    // System.out.println(buf.inspect());
    int out = proto.readI32();
    if (out != n) {
      throw new RuntimeException("I32 was supposed to be " + n + " but was " + out);
    }
View Full Code Here


        TIOStreamTransport headerTransport = new TIOStreamTransport( header );

        TProtocol headerProtocol = protocolFactory.getProtocol( headerTransport );

        headerProtocol.writeI16( magic );
        headerProtocol.writeI32( Integer.MAX_VALUE );
        headerProtocol.writeI16( Short.MAX_VALUE );
        headerProtocol.writeByte( version );
        headerProtocol.writeString( serviceName );
        headerProtocol.writeI64( id );
        headerProtocol.getTransport().flush();
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.