Package org.apache.thrift.transport

Examples of org.apache.thrift.transport.TIOStreamTransport


    if (setUpComplete) {
      return;
    }

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    TIOStreamTransport transport = new TIOStreamTransport(out);
    TBinaryProtocol protocol = new TBinaryProtocol(transport);

    IntString intString = new IntString(1, "one", 1);
    intString.write(protocol);
    BytesWritable bytesWritable = new BytesWritable(out.toByteArray());
View Full Code Here


      buffer_ = ByteBuffer.allocate(4);

      frameTrans_ = new TMemoryInputTransport();
      response_ = new TByteArrayOutputStream();
      inTrans_ = inputTransportFactory_.getTransport(frameTrans_);
      outTrans_ = outputTransportFactory_.getTransport(new TIOStreamTransport(response_));
      inProt_ = inputProtocolFactory_.getProtocol(inTrans_);
      outProt_ = outputProtocolFactory_.getProtocol(outTrans_);

      if (eventHandler_ != null) {
        context_ = eventHandler_.createContext(inProt_, outProt_);
View Full Code Here

      throw new IOException("can not read FileMetaData: " + e.getMessage(), e);
    }
  }

  private static TProtocol protocol(OutputStream to) {
    return protocol(new TIOStreamTransport(to));
  }
View Full Code Here

  private static TProtocol protocol(OutputStream to) {
    return protocol(new TIOStreamTransport(to));
  }

  private static TProtocol protocol(InputStream from) {
    return protocol(new TIOStreamTransport(from));
  }
View Full Code Here

      constructor.newInstance();
    } catch (Exception e) {
      throw new IllegalArgumentException(e);
    }
    this.thriftClass = thriftClass;
    tioStreamTransport = new TIOStreamTransport(in);
    tCompactProtocol = new TCompactProtocol(tioStreamTransport);
  }
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

    /**
     * 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

    /**
     * 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

            throw new WebApplicationException(e);
        }
    }

    static <T extends TBase> T unmarshal(Class<T> type, MediaType mediaType, InputStream entityStream) throws Exception {
        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

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.