Examples of ByteBuffer


Examples of streamer.ByteBuffer

        // packet in bytes.
        int compressedLength = buf.readUnsignedShortLE();
        if (compressedLength != 0)
            throw new RuntimeException("Compression of protocol packets is not supported. Data: " + buf + ".");

        ByteBuffer data = buf.readBytes(uncompressedLength - 18);
        buf.unref();

        switch (type2) {

        case PDUTYPE2_UPDATE: {

            // (2 bytes): A 16-bit, unsigned integer. Type of the graphics update.
            int updateType = data.readUnsignedShortLE();
            ByteBuffer payload = data.readBytes(data.length - data.cursor);
            data.unref();

            switch (updateType) {
            case UPDATETYPE_ORDERS:
                pushDataToPad("orders", payload);
                break;
            case UPDATETYPE_BITMAP:
                pushDataToPad("bitmap", payload);
                break;
            case UPDATETYPE_PALETTE:
                pushDataToPad("palette", payload);
                break;
            case UPDATETYPE_SYNCHRONIZE:
                // Ignore
                payload.unref();
                break;
            }

            break;
        }
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.