Package org.fusesource.hawtbuf

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


    public MQTTFrame encode() {
        try {
            DataByteArrayOutputStream os = new DataByteArrayOutputStream();
            QoS qos = qos();
            if(qos != QoS.AT_MOST_ONCE) {
                os.writeShort(messageId);
            }
            for(Topic topic: topics) {
                MessageSupport.writeUTF(os, topic.name());
                os.writeByte(topic.qos().ordinal());
            }
View Full Code Here


    public MQTTFrame encode() {
        try {
            DataByteArrayOutputStream os = new DataByteArrayOutputStream();
            QoS qos = qos();
            if(qos != QoS.AT_MOST_ONCE) {
                os.writeShort(messageId);
            }
            for(UTF8Buffer topic: topics) {
                MessageSupport.writeUTF(os, topic);
            }
View Full Code Here

    }
   
    public MQTTFrame encode() {
        try {
            DataByteArrayOutputStream os = new DataByteArrayOutputStream(2+grantedQos.length);
            os.writeShort(messageId);
            os.write(grantedQos);

            MQTTFrame frame = new MQTTFrame();
            frame.commandType(TYPE);
            return frame.buffer(os.toBuffer());
View Full Code Here

            }
            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

    }
   
    public MQTTFrame encode() {
        try {
            DataByteArrayOutputStream os = new DataByteArrayOutputStream(2);
            os.writeShort(messageId);

            MQTTFrame frame = new MQTTFrame();
            frame.header(header());
            frame.commandType(TYPE);
            return frame.buffer(os.toBuffer());
View Full Code Here

        }

        public MQTTFrame encode() {
            try {
                DataByteArrayOutputStream os = new DataByteArrayOutputStream(2);
                os.writeShort(messageId);

                MQTTFrame frame = new MQTTFrame();
                frame.commandType(messageType());
                return frame.buffer(os.toBuffer());
            } catch (IOException e) {
View Full Code Here

        try {
            DataByteArrayOutputStream variableHeader = new DataByteArrayOutputStream();
            MessageSupport.writeUTF(variableHeader, topicName);
            QoS qos = qos();
            if(qos != QoS.AT_MOST_ONCE) {
                variableHeader.writeShort(messageId);
            }
            MQTTFrame frame = new MQTTFrame();
            frame.header(header());
            frame.commandType(TYPE);
            if(payload==null || payload.length==0) {
View Full Code Here

    private void writePageFileHeader(int freePageExtent) throws IOException {
        DataByteArrayOutputStream os = new DataByteArrayOutputStream();
        os.write(HAWT_DB_PAGE_FILE_MAGIC);
        os.writeInt(freePageExtent);
        os.writeInt(headerSize);
        os.writeShort(pageSize);
        os.close();
        mappedFileFactory.getMemoryMappedFile().write(0, os.toBuffer());
    }

    /**
 
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.