Examples of position()


Examples of org.apache.mina.common.ByteBuffer.position()

            buf = in;
            usingSessionBuffer = false;
        }

        for (;;) {
            int oldPos = buf.position();
            boolean decoded = doDecode(session, buf, out);
            if (decoded) {
                if (buf.position() == oldPos) {
                    throw new IllegalStateException(
                            "doDecode() can't return true when buffer is not consumed.");
View Full Code Here

Examples of org.apache.mina.common.IoBuffer.position()

        if (!(message instanceof IoBuffer)) {
            return false;
        }
       
        IoBuffer buf = (IoBuffer) message;
        int offset = buf.position();
        return buf.remaining() == 23 &&
               buf.get(offset + 0) == 0x15 && buf.get(offset + 1) == 0x03 &&
               buf.get(offset + 2) == 0x01 && buf.get(offset + 3) == 0x00 &&
               buf.get(offset + 4) == 0x12;
    }
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.position()

        session.increaseWrittenBytes(localWrittenBytes, currentTime);

        if (!buf.hasRemaining() || !hasFragmentation && localWrittenBytes != 0) {
            // Buffer has been sent, clear the current request.
            int pos = buf.position();
            buf.reset();
           
            fireMessageSent(session, req);
           
            // And set it back to its position
View Full Code Here

Examples of org.apache.qpid.proton.codec.DroppingWritableBuffer.position()

         MessageImpl protonMessage = new MessageImpl(header, deliveryAnnotations, messageAnnotations, props, applicationProperties, section, footer);
         protonMessage.setMessageFormat(getMessageFormat(message.getLongProperty(new SimpleString(PROTON_MESSAGE_FORMAT))));
         ByteBuffer buffer = ByteBuffer.wrap(new byte[size]);
         final DroppingWritableBuffer overflow = new DroppingWritableBuffer();
         int c = protonMessage.encode(new CompositeWritableBuffer(new WritableBuffer.ByteBufferWrapper(buffer), overflow));
         if (overflow.position() > 0)
         {
            buffer = ByteBuffer.wrap(new byte[1024 * 4 + overflow.position()]);
            c = protonMessage.encode(new WritableBuffer.ByteBufferWrapper(buffer));
         }

View Full Code Here

Examples of org.apache.qpid.transport.codec.BBEncoder.position()

            {
                enc.writeUint16(0x0100);
            }
        }
        method.write(enc);
        int methodLimit = enc.position();

        byte flags = FIRST_SEG;

        boolean payload = method.hasPayload();
        if (!payload)
View Full Code Here

Examples of org.apache.tomcat.lite.io.BBucket.position()

        init();
        BBucket bb = in.peekFirst();

        while (bb != null && len > 0) {
            dStream.next_in = bb.array();
            dStream.next_in_index = bb.position();
            int rd = Math.min(bb.remaining(), len);
            dStream.avail_in = rd;

            while (true) {
                ByteBuffer outB = out.getWriteBuffer();
View Full Code Here

Examples of org.apache.tomcat.lite.io.BBuffer.position()

            int urlStart = url.indexOf('/', firstSlash + 2);
            serverNameMB.recycle();
            serverNameMB.appendAscii(url.array(),
                    url.getStart() + firstSlash + 2, urlStart - firstSlash - 2);

            url.position(url.getStart() + urlStart);
        }
        if (!httpCh.normalize(getMsgBytes().url())) {
            httpCh.getResponse().setStatus(400);
            httpCh.abort("Error normalizing url " +
                    getMsgBytes().url());
View Full Code Here

Examples of org.archive.io.SeekInputStream.position()

    throws IOException {
        List<Entry> entries = wordDoc.getRoot().list();
        Entry main = find(entries, "WordDocument");
        SeekInputStream mainStream = main.open();
       
        mainStream.position(10);
        int flags = Endian.littleChar(mainStream);
        boolean complex = (flags & 0x0004) == 0x0004;
        boolean tableOne = (flags & 0x0200) == 0x0200;
        String tableName = tableOne ? "1Table" : "0Table";
        Entry table = find(entries, tableName);
View Full Code Here

Examples of org.chromium.sdk.internal.v8native.protocol.input.data.FunctionValueHandle.position()

  public TextStreamPosition getOpenParenPosition() throws MethodIsBlockingException {
    if (openParenPosition == null) {
      final FunctionValueHandle functionValueHandle = getAdditionalPropertyData();
      openParenPosition = new TextStreamPosition() {
        @Override public int getOffset() {
          return castLongToInt(functionValueHandle.position(), NO_POSITION);
        }
        @Override public int getLine() {
          return castLongToInt(functionValueHandle.line(), NO_POSITION);
        }
        @Override public int getColumn() {
View Full Code Here

Examples of org.codehaus.activemq.message.util.WireByteArrayInputStream.position()

        if (ba.get(ActiveMQMessage.PAYLOAD_INDEX)) {
            int payloadLength = dataIn.readInt();
            if (payloadLength >= 0) {
                if (dataIn instanceof WireByteArrayInputStream){
                    WireByteArrayInputStream wireIn = (WireByteArrayInputStream)dataIn;
                    msg.setBodyAsBytes(wireIn.getRawData(), wireIn.position(), payloadLength);
                }else {
                byte[] payload = new byte[payloadLength];
                dataIn.readFully(payload);
                msg.setBodyAsBytes(payload,0,payload.length);
                }
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.