Examples of asByteBuffer()


Examples of org.apache.qpid.amqp_1_0.type.Binary.asByteBuffer()

            }
            else if(value instanceof Binary)
            {
                Binary binary = (Binary)value;
                byte[] data = new byte[binary.getLength()];
                binary.asByteBuffer().get(data);
                return data;
            }
            else
            {
                // Throw exception instead?
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.type.Binary.asByteBuffer()

        Object o = getCorrelationId();
        if(o instanceof Binary)
        {
            Binary correlationIdBinary = (Binary) o;
            byte[] correlationId = new byte[correlationIdBinary.getLength()];
            correlationIdBinary.asByteBuffer().get(correlationId);
            return correlationId;
        }
        else
        {
            return o == null ? null : o.toString().getBytes();
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.DataInfo.asByteBuffer()

        DataInfo dataInfo = exchanger.exchange(null, 5, TimeUnit.SECONDS);
        checkThatWeAreFlowControlStalled(exchanger);

        Assert.assertEquals(windowSize, dataInfo.available());
        Assert.assertEquals(0, dataInfo.consumed());
        dataInfo.asByteBuffer(true);

        dataInfo = exchanger.exchange(null, 5, TimeUnit.SECONDS);
        checkThatWeAreFlowControlStalled(exchanger);

        Assert.assertEquals(0, dataInfo.available());
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.DataInfo.asByteBuffer()

        dataInfo = exchanger.exchange(null, 5, TimeUnit.SECONDS);
        checkThatWeAreFlowControlStalled(exchanger);

        Assert.assertEquals(dataInfo.length() / 2, dataInfo.consumed());
        dataInfo.asByteBuffer(true);

        dataInfo = exchanger.exchange(null, 5, TimeUnit.SECONDS);
        Assert.assertEquals(dataInfo.length(), dataInfo.consumed());
        // Check that we are not flow control stalled
        dataInfo = exchanger.exchange(null, 5, TimeUnit.SECONDS);
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.DataInfo.asByteBuffer()

        DataInfo dataInfo = exchanger.exchange(null, 5, TimeUnit.SECONDS);
        checkThatWeAreFlowControlStalled(exchanger);

        Assert.assertEquals(windowSize, dataInfo.available());
        Assert.assertEquals(0, dataInfo.consumed());
        dataInfo.asByteBuffer(true);

        dataInfo = exchanger.exchange(null, 5, TimeUnit.SECONDS);
        checkThatWeAreFlowControlStalled(exchanger);

        Assert.assertEquals(0, dataInfo.available());
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.DataInfo.asByteBuffer()

        dataInfo = exchanger.exchange(null, 5, TimeUnit.SECONDS);
        checkThatWeAreFlowControlStalled(exchanger);

        Assert.assertEquals(dataInfo.length() / 2, dataInfo.consumed());
        dataInfo.asByteBuffer(true);

        dataInfo = exchanger.exchange(null, 5, TimeUnit.SECONDS);
        Assert.assertEquals(dataInfo.length(), dataInfo.consumed());
        // Check that we are not flow control stalled
        dataInfo = exchanger.exchange(null, 5, TimeUnit.SECONDS);
View Full Code Here

Examples of org.jscsi.parser.datasegment.SettingsMap.asByteBuffer()

        final TextRequestParser parser = (TextRequestParser) protocolDataUnit.getBasicHeaderSegment().getParser();

        final SettingsMap settings = new SettingsMap();
        settings.add(OperationalTextKey.SEND_TARGETS, "");

        final IDataSegment dataSegment = DataSegmentFactory.create(settings.asByteBuffer(), DataSegmentFormat.TEXT, connection.getSettingAsInt(OperationalTextKey.MAX_RECV_DATA_SEGMENT_LENGTH));

        int bytes2Process = dataSegment.getLength();
        for (IDataSegmentIterator dataSegmentIterator = dataSegment.iterator(); dataSegmentIterator.hasNext();) {
            IDataSegmentChunk dataSegmentChunk = dataSegmentIterator.next(bytes2Process);
            protocolDataUnit.setDataSegment(dataSegmentChunk);
View Full Code Here

Examples of org.jscsi.parser.datasegment.SettingsMap.asByteBuffer()

        LoginRequestParser loginRequest;
        boolean continueFlag;
        // here the finalFlag represents the transitFlag
        boolean finalFlag;
        final IDataSegment dataSegment = DataSegmentFactory.create(loginParameters.asByteBuffer(), DataSegmentFormat.TEXT, maxRecvDataSegmentLength);
        final IDataSegmentIterator iterator = dataSegment.iterator();
        final Queue<ProtocolDataUnit> protocolDataUnits = new LinkedList<ProtocolDataUnit>();

        IDataSegmentChunk dataSegmentChunk;
        ProtocolDataUnit protocolDataUnit;
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.