Package org.apache.thrift.protocol

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


  }

  public static void testNakedBinary(byte[] data) throws Exception {
    TMemoryBuffer buf = new TMemoryBuffer(0);
    TProtocol proto = factory.getProtocol(buf);
    proto.writeBinary(data);
    // System.out.println(buf.inspect());
    byte[] out = proto.readBinary();
    if (!Arrays.equals(data, out)) {
      throw new RuntimeException("Binary was supposed to be '" + data + "' but was '" + out + "'");
    }
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;
    }

    private void readFirstChunk(TProtocol inProtocol) throws TException
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.