Package org.fusesource.hawtbuf

Examples of org.fusesource.hawtbuf.DataByteArrayOutputStream.writeByte()


                if (!sizePrefixDisabled) {
                    bytesOut.restart();
                    looseOut = bytesOut;
                }

                looseOut.writeByte(type);
                dsm.looseMarshal(this, c, looseOut);

                if (!sizePrefixDisabled) {
                    Buffer sequence = bytesOut.toBuffer();
                    dataOut.writeInt(sequence.getLength());
View Full Code Here


                if (!sizePrefixDisabled) {
                    bytesOut.restart();
                    looseOut = bytesOut;
                }

                looseOut.writeByte(type);
                dsm.looseMarshal(this, c, looseOut);

                if (!sizePrefixDisabled) {
                    Buffer sequence = bytesOut.toBuffer();
                    dataOut.writeInt(sequence.getLength());
View Full Code Here

                    if (!authSent && !mechanisims.isEmpty()) {
                        if (mechanisims.contains("PLAIN")) {
                            authSent = true;
                            DataByteArrayOutputStream os = new DataByteArrayOutputStream();
                            try {
                                os.writeByte(0);
                                os.write(new UTF8Buffer(options.getUser()));
                                os.writeByte(0);
                                if (options.getPassword() != null) {
                                    os.write(new UTF8Buffer(options.getPassword()));
                                }
View Full Code Here

                            authSent = true;
                            DataByteArrayOutputStream os = new DataByteArrayOutputStream();
                            try {
                                os.writeByte(0);
                                os.write(new UTF8Buffer(options.getUser()));
                                os.writeByte(0);
                                if (options.getPassword() != null) {
                                    os.write(new UTF8Buffer(options.getPassword()));
                                }
                            } catch (IOException e) {
                                throw new RuntimeException(e);
View Full Code Here

                        }
                        authSent = true;
                        DataByteArrayOutputStream os = new DataByteArrayOutputStream();
                        try {
                            os.write(new UTF8Buffer(options.getUser()));
                            os.writeByte(0);
                            if (options.getPassword() != null) {
                                os.write(new UTF8Buffer(options.getPassword()));
                                os.writeByte(0);
                            }
                        } catch (IOException e) {
View Full Code Here

                        try {
                            os.write(new UTF8Buffer(options.getUser()));
                            os.writeByte(0);
                            if (options.getPassword() != null) {
                                os.write(new UTF8Buffer(options.getPassword()));
                                os.writeByte(0);
                            }
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }
                        Buffer buffer = os.toBuffer();
View Full Code Here

            if(qos != QoS.AT_MOST_ONCE) {
                os.writeShort(messageId);
            }
            for(Topic topic: topics) {
                MessageSupport.writeUTF(os, topic.name());
                os.writeByte(topic.qos().ordinal());
            }

            MQTTFrame frame = new MQTTFrame();
            frame.header(header());
            frame.commandType(TYPE);
View Full Code Here

                throw new IllegalArgumentException("A clean session must be used when no clientId is specified");
            }
            DataByteArrayOutputStream os = new DataByteArrayOutputStream(500);
            if(version==3) {
                MessageSupport.writeUTF(os, V3_PROTOCOL_NAME);
                os.writeByte(version);
            } else if(version >= 4) {
                MessageSupport.writeUTF(os, V4_PROTOCOL_NAME);
                os.writeByte(version);
            } else {
                throw new IllegalArgumentException("Invalid version: "+version);
View Full Code Here

            if(version==3) {
                MessageSupport.writeUTF(os, V3_PROTOCOL_NAME);
                os.writeByte(version);
            } else if(version >= 4) {
                MessageSupport.writeUTF(os, V4_PROTOCOL_NAME);
                os.writeByte(version);
            } else {
                throw new IllegalArgumentException("Invalid version: "+version);
            }

            int flags = 0;
View Full Code Here

                flags |= (willQos << 3) & 0x18;
            }
            if(cleanSession) {
                flags |= 0x02;
            }
            os.writeByte(flags);
            os.writeShort(keepAlive);
            MessageSupport.writeUTF(os, clientId);
            if(willTopic!=null && willMessage!=null) {
                MessageSupport.writeUTF(os, willTopic);
                MessageSupport.writeUTF(os, willMessage);
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.