Package org.apache.thrift.transport

Examples of org.apache.thrift.transport.TIOStreamTransport


                        OutputStream entityStream) throws IOException, WebApplicationException {
        marshal(t, mediaType, entityStream);
    }

    static <T extends TBase> void marshal(T t, MediaType mediaType, OutputStream entityStream) throws IOException {
        TIOStreamTransport transport = new TIOStreamTransport(entityStream);
        TProtocol protocol = null;
        if (THRIFT_TYPE.isCompatible(mediaType)) {
            protocol = new TBinaryProtocol.Factory().getProtocol(transport);
        } else if (MediaType.APPLICATION_JSON_TYPE.isCompatible(mediaType)) {
            protocol = new TJSONProtocol.Factory().getProtocol(transport);
View Full Code Here


    /**
     * Get the transport that should be used by the invoker for responding.
     */
    private TTransport getOutputTransport() {
      response_ = new TByteArrayOutputStream();
      return outputTransportFactory_.getTransport(new TIOStreamTransport(response_));
    }
View Full Code Here

    /**
     * Get the transport that should be used by the invoker for responding.
     */
    private TTransport getOutputTransport() {
      response_ = new TByteArrayOutputStream();
      return outputTransportFactory_.getTransport(new TIOStreamTransport(response_));
    }
View Full Code Here

   * @param bytes The array to read from
   */
  public void deserialize(TBase base, byte[] bytes) throws TException {
    base.read(
        protocolFactory_.getProtocol(
          new TIOStreamTransport(
            new ByteArrayInputStream(bytes))));
  }
View Full Code Here

      deserialize(tb, bytes);
      return;
    }

    TProtocol iprot = protocolFactory_.getProtocol(
        new TIOStreamTransport(
          new ByteArrayInputStream(bytes)));

    // index into field ID path being currently searched for
    int curPathIndex = 0;
View Full Code Here

    /**
     * Wrap the read buffer in a memory-based transport so a processor can read
     * the data it needs to handle an invocation.
     */
    private TTransport getInputTransport() {
      return inputTransportFactory_.getTransport(new TIOStreamTransport(
        new ByteArrayInputStream(buffer_.array())));
    }
View Full Code Here

    /**
     * Get the transport that should be used by the invoker for responding.
     */
    private TTransport getOutputTransport() {
      response_ = new TByteArrayOutputStream();
      return outputTransportFactory_.getTransport(new TIOStreamTransport(response_));
    }
View Full Code Here

          "org.apache.thrift.protocol");
      TProtocolFactory protFactory = TReflectionUtils
          .getProtocolFactoryByName(protoName);
      bos_ = new ByteStream.Output();
      bis_ = new ByteStream.Input();
      tios = new TIOStreamTransport(bis_, bos_);

      oprot_ = protFactory.getProtocol(tios);
      iprot_ = protFactory.getProtocol(tios);

      /**
 
View Full Code Here

    private ByteStream.Output bos;
    private TProtocol outProtocol;

    public ThriftSerializer() {
      bos = new ByteStream.Output();
      TIOStreamTransport outTransport = new TIOStreamTransport(bos);
      TProtocolFactory outFactory = new TBinaryProtocol.Factory();
      outProtocol = outFactory.getProtocol(outTransport);
    }
View Full Code Here

class ThriftHadoopSerializer implements Serializer<TBase> {
  private TTransport mTransport;

  @Override
  public void open(OutputStream os) {
    mTransport = new TIOStreamTransport(os);
  }
View Full Code Here

TOP

Related Classes of org.apache.thrift.transport.TIOStreamTransport

Copyright © 2018 www.massapicom. 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.