Examples of ByteBufferInputStream


Examples of atg.core.io.ByteBufferInputStream

        public void prepareForRead() {
            if (mBuffer != null) {
                mBuffer.flip();
            }
            mInputStream = new TestingHttpConnectionServletInputStream(
                    new ByteBufferInputStream(mBuffer), mBuffer.limit()
            );
            mRequest.setInputStream(mInputStream);
        }
View Full Code Here

Examples of co.cask.cdap.internal.io.ByteBufferInputStream

    SchemaHash schemaHash = new SchemaHash(buffer);
    Preconditions.checkArgument(schemaHash.equals(STREAM_EVENT_SCHEMA.getSchemaHash()),
                                "Schema from payload not matching StreamEvent schema.");

    Decoder decoder = new BinaryDecoder(new ByteBufferInputStream(buffer));

    try {
      StreamEventData data = StreamEventDataCodec.decode(decoder);

      // Read the timestamp
View Full Code Here

Examples of co.cask.tigon.internal.io.ByteBufferInputStream

  }

  private <T> Function<ByteBuffer, T> createInputDatumDecoder(final TypeToken<T> dataType, final Schema schema,
                                                              final SchemaCache schemaCache) {
    final ReflectionDatumReader<T> datumReader = new ReflectionDatumReader<T>(schema, dataType);
    final ByteBufferInputStream byteBufferInput = new ByteBufferInputStream(null);
    final BinaryDecoder decoder = new BinaryDecoder(byteBufferInput);

    return new Function<ByteBuffer, T>() {
      @Nullable
      @Override
      public T apply(ByteBuffer input) {
        byteBufferInput.reset(input);
        try {
          final Schema sourceSchema = schemaCache.get(input);
          Preconditions.checkNotNull(sourceSchema, "Fail to find source schema.");
          return datumReader.read(decoder, sourceSchema);
        } catch (IOException e) {
View Full Code Here

Examples of co.paralleluniverse.common.io.ByteBufferInputStream

         * IMPORTANT:
         * We need to take care of the situation where a simple set is invoked (w/o getx beforehand).
         * The returned PUTX will call received which will overwrite the object (which we wanted to set as the value
         * for the line)
         */
        this.obj = deserialize(new ByteBufferInputStream(buffer));
    }
View Full Code Here

Examples of com.alibaba.wasp.util.ByteBufferInputStream

        Message returnValue = null;
        thread2Address.put(Thread.currentThread(), (InetSocketAddress) ctx
            .getChannel().getRemoteAddress());
        NettyDataPack dataPack = (NettyDataPack) e.getMessage();
        List<ByteBuffer> req = dataPack.getDatas();
        ByteBufferInputStream dis = new ByteBufferInputStream(req);
        ConnectionHeader header = ConnectionHeader.parseDelimitedFrom(dis);
        @SuppressWarnings("unused")
        RpcRequestHeader request = RpcRequestHeader.parseDelimitedFrom(dis);
        RpcRequestBody rpcRequestBody;
        try {
View Full Code Here

Examples of com.cloudera.util.ByteBufferInputStream

    Event e = null;
    do { // loop until we get a valid packet, drop bad ones.
      sock.receive(pkt);

      ByteBuffer bb = ByteBuffer.wrap(buf, 0, pkt.getLength());
      ByteBufferInputStream bbis = new ByteBufferInputStream(bb);
      DataInputStream in = new DataInputStream(bbis);
      try {
        e = SyslogWireExtractor.extractEvent(in);
      } catch (EventExtractException ex) {
        rejects++;
View Full Code Here

Examples of com.comphenix.protocol.utility.ByteBufferInputStream

   * <p>
   * It's safe to modify the position of the buffer.
   * @param buffer - a read-only byte source.
   */
  protected ByteBuffer skipHeader(ByteBuffer buffer) throws IOException {
    skipHeader(new DataInputStream(new ByteBufferInputStream(buffer)));
    return buffer;
  }
View Full Code Here

Examples of com.esotericsoftware.kryo.io.ByteBufferInputStream

    Output testOutput = new Output(byteBufferOutputStream);
    testOutput.writeBytes(new byte[512]);
    testOutput.writeBytes(new byte[512]);
    testOutput.flush();

    ByteBufferInputStream testInputs = new ByteBufferInputStream();
    buf.flip();
    testInputs.setByteBuffer(buf);
    Input input = new Input(testInputs, 512);
    byte[] toRead = new byte[512];
    input.readBytes(toRead);

    input.readBytes(toRead);   
View Full Code Here

Examples of com.sun.enterprise.web.connector.grizzly.ByteBufferInputStream

                            // If the protocol wasn't found, it might be because
                            // lack of missing bytes. Thus we must register the key for
                            // extra bytes. The trick here is to re-use the ReadTask
                            // ByteBufferInpuStream.
                            if (bbInputStream == null) {
                                bbInputStream = new ByteBufferInputStream();
                            }
                           
                            ByteBuffer tmpBB = protocolInfo.inputBB;
                           
                            if (tmpBB == null) {
View Full Code Here

Examples of com.sun.grizzly.util.ByteBufferInputStream

    public void initialize(boolean secure){
        request  = new HttpRequest();
        inputBuffer = new HttpInputBuffer(request);
        inputStream = secure ? new SSLByteBufferInputStream()
        : new ByteBufferInputStream();
       
        inputBuffer.setInputStream(inputStream);
        request.setInputBuffer(inputBuffer);
        response = new Response();
        outputBuffer = secure ? new SSLOutputBuffer(response,
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.