Package org.fusesource.mqtt.codec

Examples of org.fusesource.mqtt.codec.MQTTFrame


        DataInputStream dis = new DataInputStream(stream);
        return unmarshal(dis);
    }

    public void marshal(Object command, DataOutput dataOut) throws IOException {
        MQTTFrame frame = (MQTTFrame) command;
        dataOut.write(frame.header());

        int remaining = 0;
        for (Buffer buffer : frame.buffers) {
            remaining += buffer.length;
        }
View Full Code Here


            if (length > 0) {
                byte[] data = new byte[length];
                dataIn.readFully(data);
                Buffer body = new Buffer(data);
                return new MQTTFrame(body).header(header);
            } else {
                return new MQTTFrame().header(header);
            }
        }
        return null;
    }
View Full Code Here

          );
        }
    }

    static void append(Buffer self, MQTTFrame value) {
        MQTTFrame frame = (MQTTFrame) value;
        self.appendByte(frame.header());

        int remaining = 0;
        for(org.fusesource.hawtbuf.Buffer buffer : frame.buffers) {
            remaining += buffer.length;
        }
View Full Code Here

                if( body==null ) {
                    return null;
                } else {
                    nextDecodeAction = readHeader;
                    // TODO: optimize out this conversion to byte[]
                    return new MQTTFrame(new org.fusesource.hawtbuf.Buffer(body.getBytes())).header(header);
                }
            }
        };
    }
View Full Code Here

TOP

Related Classes of org.fusesource.mqtt.codec.MQTTFrame

Copyright © 2018 www.massapicom. 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.