Examples of writeI16()


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

        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() );
View Full Code Here

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

        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();
        headerLength = bos.size();
View Full Code Here

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

        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 );
        }
        // prepare
View Full Code Here

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

        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() );
View Full Code Here

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

        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();
        headerLength = bos.size();
View Full Code Here

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

        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 );
        }
        // prepare
View Full Code Here

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

  }

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

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

        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 );
View Full Code Here

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

        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

Examples of org.apache.thrift.protocol.TTupleProtocol.writeI16()

      oprot.writeBitSet(optionals, 3);
      if (struct.isSetIpv4()) {
        oprot.writeI32(struct.ipv4);
      }
      if (struct.isSetPort()) {
        oprot.writeI16(struct.port);
      }
      if (struct.isSetService_name()) {
        oprot.writeString(struct.service_name);
      }
    }
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.