Examples of readFrom()


Examples of ie.omk.smpp.message.SMPPPacket.readFrom()

            this.buf = link.read(this.buf);
            id = SMPPIO.bytesToInt(this.buf, 4, 4);
            pak = PacketFactory.newInstance(id);

            if (pak != null) {
                pak.readFrom(this.buf, 0);
                if (LOGGER.isDebugEnabled()) {
                    StringBuffer b = new StringBuffer("Packet Received: ");
                    int l = pak.getLength();
                    int s = pak.getCommandStatus();
                    int n = pak.getSequenceNum();
View Full Code Here

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

    public void testSerializationReadFrom() throws Exception {
        byte[] buf = new byte[]
                { 0,0,2,2,4,99,111,108,49,4,99,111,108,50,0,0,0,2,0,9,114,111,119,49,95,99,111,108,49,0,9,114,111,119,49,95,99,111,108,50,0,9,114,111,119,50,95,99,111,108,49,0,9,114,111,119,50,95,99,111,108,50,0,1,0,0,0,2,4,4};
        BytesStreamInput in = new BytesStreamInput(buf, false);
        SQLResponse resp = new SQLResponse();
        resp.readFrom(in);

        assertThat(resp.cols(), is(new String[] { "col1", "col2" }));
        assertThat(resp.rows(), is(new Object[][] {
                new Object[] {"row1_col1", "row1_col2"},
                new Object[] {"row2_col1", "row2_col2"},
View Full Code Here

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

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

        PutChunkReplicaRequest requestIn = new PutChunkReplicaRequest();
        requestIn.readFrom(inputStream);

        assertEquals(requestOut.currentPos, requestIn.currentPos);
        assertEquals(requestOut.isLast, requestIn.isLast);
        assertEquals(requestOut.content, requestIn.content);
        assertEquals(requestOut.transferId, requestIn.transferId);
View Full Code Here

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

        DistributedRequestContextManager contextManager =
                new DistributedRequestContextManager(new DummyDownstreamOperationFactory(rows), functions,
                        new StatsTables(ImmutableSettings.EMPTY, mock(NodeSettingsService.class)));
        BytesStreamInput streamInput = new BytesStreamInput(streamOutput.bytes());
        DistributedResultRequest requestReceiver = new DistributedResultRequest(contextManager);
        requestReceiver.readFrom(streamInput);

        assertFalse(requestReceiver.rowsRead());
        assertNotNull(requestReceiver.memoryStream());
        assertTrue(requestReceiver.memoryStream().size() > 0);
View Full Code Here

Examples of io.crate.metadata.ColumnIdent.readFrom()

        int numPks = in.readVInt();
        primaryKeys = new ArrayList<>(numPks);
        for (int i = 0; i < numPks; i++) {
            ColumnIdent ident = new ColumnIdent();
            ident.readFrom(in);
            primaryKeys.add(ident);
        }

        int numPartitionedSymbols = in.readVInt();
        partitionedBySymbols = new ArrayList<>(numPartitionedSymbols);
View Full Code Here

Examples of io.crate.metadata.ReferenceInfo.readFrom()

        int numPartitionBy = in.readVInt();
        partitionBy = new ArrayList<>(numPartitionBy);
        for (int i = 0; i < numPartitionBy; i++) {
            ReferenceInfo referenceInfo = new ReferenceInfo();
            referenceInfo.readFrom(in);
            partitionBy.add(referenceInfo);
        }
    }

    @Override
View Full Code Here

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

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

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

    @Test
    public void testFloat() throws Exception {
View Full Code Here

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

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

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

        assertEquals(cn.toCollect(), cn2.toCollect());
        assertEquals(cn.downStreamNodes(), cn2.downStreamNodes());
        assertEquals(cn.maxRowGranularity(), cn.maxRowGranularity());
View Full Code Here

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

        node.writeTo(output);


        BytesStreamInput input = new BytesStreamInput(output.bytes());
        MergeNode node2 = new MergeNode();
        node2.readFrom(input);

        assertThat(node.numUpstreams(), is(node2.numUpstreams()));
        assertThat(node.executionNodes(), is(node2.executionNodes()));
        assertThat(node.contextId(), is(node2.contextId()));
        assertThat(node.inputTypes(), is(node2.inputTypes()));
View Full Code Here

Examples of jade.imtp.leap.http.HTTPRequest.readFrom()

  private static Logger log = Logger.getLogger(NIOHTTPHelper.class.getName());


  public static ByteBuffer readByteBufferFromHttp(InputStream is) throws IOException {
    HTTPRequest request = new HTTPRequest();
    request.readFrom(is);
    if (is.markSupported()) {
      is.mark(2);
      if (is.read() != -1) {
        is.reset();
        throw new IOException("bytes left in stream after constructing HTTPRequest");
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.