Examples of writeTo()


Examples of io.crate.action.sql.SQLResponse.writeTo()

        r1 = new SQLResponse();
        r1.cols(new String[]{});
        r1.colTypes(new DataType[]{});
        r1.rows(new Object[][]{new String[]{}});

        r1.writeTo(o);

        r2 = new SQLResponse();
        r2.readFrom(new BytesStreamInput(o.bytes()));

View Full Code Here

Examples of io.crate.blob.PutChunkReplicaRequest.writeTo()

        requestOut.currentPos = 10;
        requestOut.isLast = false;
        requestOut.content = new BytesArray(new byte[] { 0x65, 0x66 });
        requestOut.sourceNodeId = "nodeId";

        requestOut.writeTo(outputStream);
        BytesStreamInput inputStream = new BytesStreamInput(outputStream.bytes().copyBytesArray());

        PutChunkReplicaRequest requestIn = new PutChunkReplicaRequest();
        requestIn.readFrom(inputStream);
View Full Code Here

Examples of io.crate.executor.transport.distributed.DistributedResultRequest.writeTo()

        DistributedResultRequest requestSender = new DistributedResultRequest(contextId, streamers);
        requestSender.rows(rows);

        BytesStreamOutput streamOutput = new BytesStreamOutput();
        requestSender.writeTo(streamOutput);
        // -- end sender


        // receiver
        DistributedRequestContextManager contextManager =
View Full Code Here

Examples of io.crate.operation.aggregation.AggregationState.writeTo()

        FunctionIdent fi = new FunctionIdent("collect_set", ImmutableList.<DataType>of(DataTypes.LONG));
        AggregationFunction impl = (AggregationFunction) functions.get(fi);
        AggregationState state = impl.newState();

        BytesStreamOutput streamOutput = new BytesStreamOutput();
        state.writeTo(streamOutput);

        AggregationState newState = impl.newState();
        newState.readFrom(new BytesStreamInput(streamOutput.bytes()));
        assertEquals(state.value(), newState.value());
    }
View Full Code Here

Examples of io.crate.planner.node.dql.CollectNode.writeTo()

        cn.downStreamNodes(ImmutableList.of("n1", "n2"));
        cn.toCollect(ImmutableList.<Symbol>of(new Value(DataTypes.STRING)));


        BytesStreamOutput out = new BytesStreamOutput();
        cn.writeTo(out);

        BytesStreamInput in = new BytesStreamInput(out.bytes());
        CollectNode cn2 = new CollectNode();
        cn2.readFrom(in);
        assertEquals(cn, cn2);
View Full Code Here

Examples of io.crate.planner.node.dql.MergeNode.writeTo()

        TopNProjection topNProjection = new TopNProjection(10, 0);

        node.projections(Arrays.asList(groupProjection, topNProjection));

        BytesStreamOutput output = new BytesStreamOutput();
        node.writeTo(output);


        BytesStreamInput input = new BytesStreamInput(output.bytes());
        MergeNode node2 = new MergeNode();
        node2.readFrom(input);
View Full Code Here

Examples of it.polito.appeal.traci.protocol.RequestMessage.writeTo()

      for (Command req : q.getRequests()) {
        reqMsg.append(req);
      }
    }
   
    reqMsg.writeTo(dos);
    ResponseMessage respMsg = new ResponseMessage(dis);
    Iterator<ResponseContainer> responseIterator = respMsg.responses().iterator();
    for (Query q : queries) {
      q.pickResponses(responseIterator);     
    }
View Full Code Here

Examples of it.polito.appeal.traci.protocol.StringList.writeTo()

  protected void writeValueTo(List<Edge> newRoute, Storage content) {
    StringList edgeIDs = new StringList();
    for (Edge e : newRoute)
      edgeIDs.add(e.getID());
   
    edgeIDs.writeTo(content, true);
  }
}
View Full Code Here

Examples of jade.imtp.leap.JICP.JICPPacket.writeTo()

    if (request.getMethod().equals("GET")) {
      String recipientID = request.getField(RECIPIENT_ID_FIELD);
      JICPPacket pkt = new JICPPacket(JICPProtocol.CONNECT_MEDIATOR_TYPE, JICPProtocol.DEFAULT_INFO, recipientID, null);
      ByteBuffer b = ByteBuffer.allocateDirect(pkt.getLength());
      MyOut out = new MyOut(b);
      pkt.writeTo(out);
      b.flip();
      return b;
    } else {
      // Read the JICPPacket from the HTTP request payload
      byte[] a = request.getPayload();
View Full Code Here

Examples of jade.imtp.leap.http.HTTPResponse.writeTo()

  private static ByteBuffer wrapInHttpResponse(ByteBuffer pkt) throws IOException {
    byte[] b = new byte[pkt.remaining()];
    pkt.get(b, 0, pkt.remaining());
    HTTPResponse response = wrapInHttp(b);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    response.writeTo(out);
    return ByteBuffer.wrap(out.toByteArray());
  }

  private static ByteBuffer constructJICPPacket(ByteBuffer input) throws IOException {
    byte[] out = new byte[input.remaining()];
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.