Package org.jboss.netty.buffer

Examples of org.jboss.netty.buffer.ChannelBuffer.readLong()


        ChannelBuffer buf = (ChannelBuffer) msg;

        buf.readUnsignedShort(); // data length

        // Identify device
        String imei = String.format("%015d", buf.readLong());
        long deviceId;
        try {
            deviceId = getDataManager().getDeviceByImei(imei).getId();
        } catch(Exception error) {
            Log.warning("Unknown device - " + imei);
View Full Code Here


                }

                // Read 8 byte data
                cnt = buf.readUnsignedByte();
                for (int j = 0; j < cnt; j++) {
                    extendedInfo.set("io" + buf.readUnsignedByte(), buf.readLong());
                }

                position.setExtendedInfo(extendedInfo.toString());
                positions.add(position);
            }
View Full Code Here

        // netty always copies a buffer, either in NioWorker in its read handler, where it copies to a fresh
        // buffer, or in the cumlation buffer, which is cleaned each time
        StreamInput streamIn = ChannelBufferStreamInputFactory.create(buffer, size);

        long requestId = buffer.readLong();
        byte status = buffer.readByte();
        Version version = Version.fromId(buffer.readInt());

        StreamInput wrappedStream;
        if (TransportStatus.isCompress(status) && hasMessageBytesToRead && buffer.readable()) {
View Full Code Here

    if (channelBuffer.readableBytes() < 16) {
      logger.debug("Incorrect packet received from " + e.getRemoteAddress());
    }

    long connectionId = channelBuffer.readLong(); // TODO: Можно проверять connectionId.
    int actionId = channelBuffer.readInt();
    int transactionId = channelBuffer.readInt();

    Action action = Action.byId(actionId);
View Full Code Here

    }

    Peer peer = new Peer();
    peer.infoHash = buffer.readBytes(20).array();
    peer.peerId = buffer.readBytes(20).array();
    peer.downloaded = buffer.readLong();
    peer.left = buffer.readLong();
    peer.uploaded = buffer.readLong();
    peer.event = buffer.readInt();
    peer.ip = buffer.readInt();
    peer.key = buffer.readInt();
View Full Code Here

    Peer peer = new Peer();
    peer.infoHash = buffer.readBytes(20).array();
    peer.peerId = buffer.readBytes(20).array();
    peer.downloaded = buffer.readLong();
    peer.left = buffer.readLong();
    peer.uploaded = buffer.readLong();
    peer.event = buffer.readInt();
    peer.ip = buffer.readInt();
    peer.key = buffer.readInt();
    peer.numWant = buffer.readInt();
View Full Code Here

    Peer peer = new Peer();
    peer.infoHash = buffer.readBytes(20).array();
    peer.peerId = buffer.readBytes(20).array();
    peer.downloaded = buffer.readLong();
    peer.left = buffer.readLong();
    peer.uploaded = buffer.readLong();
    peer.event = buffer.readInt();
    peer.ip = buffer.readInt();
    peer.key = buffer.readInt();
    peer.numWant = buffer.readInt();
    peer.port = buffer.readShort();
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.