Package org.jboss.netty.buffer

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


        ChannelBuffer buffer = (ChannelBuffer) e.getMessage();

        int type = buffer.readInt();
        buffer.readerIndex(24);
        long ledgerId = buffer.readLong();
        long entryId = buffer.readLong();

        ChannelBuffer outBuf = ctx.getChannel().getConfig().getBufferFactory()
                               .getBuffer(24);
        outBuf.writeInt(type);
        outBuf.writeInt(0); // rc
View Full Code Here


        final PacketHeader header;

        try {
            header = PacketHeader.fromInt(buffer.readInt());
            rc = buffer.readInt();
            ledgerId = buffer.readLong();
            entryId = buffer.readLong();
        } catch (IndexOutOfBoundsException ex) {
            LOG.error("Unparseable response from bookie: " + addr, ex);
            return;
        }
View Full Code Here

        try {
            header = PacketHeader.fromInt(buffer.readInt());
            rc = buffer.readInt();
            ledgerId = buffer.readLong();
            entryId = buffer.readLong();
        } catch (IndexOutOfBoundsException ex) {
            LOG.error("Unparseable response from bookie: " + addr, ex);
            return;
        }
View Full Code Here

    // The differences between v0 and v1 are irrelevant to us,
    // as we only look at the first few fields, and they didn't
    // change across these 2 versions.
    final byte[] stop_key = HBaseRpc.readByteArray(buf);
    final boolean offline = buf.readByte() != 0;
    final long region_id = buf.readLong();
    final byte[] region_name = HBaseRpc.readByteArray(buf);
    // TODO(tsuna): Can we easily de-dup this array with another RegionInfo?
    byte[] table;
    try {
      table = tableFromRegionName(region_name);
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());

        // !!! compression handling removed !!!
        StreamInput wrappedStream = CachedStreamInput.cachedHandles(streamIn);
View Full Code Here

        short extraLength = headerBuffer.readUnsignedByte();
        short dataType = headerBuffer.readUnsignedByte();   // unused
        short reserved = headerBuffer.readShort(); // unused
        int totalBodyLength = headerBuffer.readInt();
        int opaque = headerBuffer.readInt();
        long cas = headerBuffer.readLong();

        // we want the whole of totalBodyLength; otherwise, keep waiting.
        if (channelBuffer.readableBytes() < totalBodyLength) {
            channelBuffer.resetReaderIndex();
            return null;
View Full Code Here

        final PacketHeader header;

        try {
            header = PacketHeader.fromInt(buffer.readInt());
            rc = buffer.readInt();
            ledgerId = buffer.readLong();
            entryId = buffer.readLong();
        } catch (IndexOutOfBoundsException ex) {
            LOG.error("Unparseable response from bookie: " + addr, ex);
            return;
        }
View Full Code Here

        try {
            header = PacketHeader.fromInt(buffer.readInt());
            rc = buffer.readInt();
            ledgerId = buffer.readLong();
            entryId = buffer.readLong();
        } catch (IndexOutOfBoundsException ex) {
            LOG.error("Unparseable response from bookie: " + addr, ex);
            return;
        }
View Full Code Here

        buf.readUnsignedShort(); // length
        int index = buf.readUnsignedShort();

        // Get device id
        long deviceId;
        long rawId = buf.readLong();
        String id = String.valueOf(rawId);
        try {
            deviceId = getDataManager().getDeviceByImei(id).getId();
        } catch(Exception error) {
            Log.warning("Unknown device - " + id);
View Full Code Here

                extendedInfo.set("gsm", buf.readUnsignedByte());

                // Milage
                extendedInfo.set("milage", buf.readUnsignedInt());

                long extraFlags = buf.readLong();

                // Analog inputs
                if ((extraFlags & 0x1) == 0x1) {
                    int count = buf.readUnsignedShort();
                    for (int i = 1; i <= count; i++) {
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.