Package org.fusesource.hawtbuf

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


                                    os.write(new UTF8Buffer(options.getPassword()));
                                }
                            } catch (IOException e) {
                                throw new RuntimeException(e);
                            }
                            Buffer buffer = os.toBuffer();
                            sasl.setMechanisms(new String[]{"PLAIN"});
                            sasl.send(buffer.data, buffer.offset, buffer.length);
                        } else if (mechanisims.contains("ANONYMOUS")) {
                            authSent = true;
                            sasl.setMechanisms(new String[]{"ANONYMOUS"});
View Full Code Here


                                os.writeByte(0);
                            }
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }
                        Buffer buffer = os.toBuffer();
                        sasl.setMechanisms(new String[]{"PLAIN"});
                        sasl.send(buffer.data, buffer.offset, buffer.length);
                    }
                    return sasl;
                }
View Full Code Here

            }

            MQTTFrame frame = new MQTTFrame();
            frame.header(header());
            frame.commandType(TYPE);
            return frame.buffer(os.toBuffer());
        } catch (IOException e) {
            throw new RuntimeException("The impossible happened");
        }
    }
View Full Code Here

            }

            MQTTFrame frame = new MQTTFrame();
            frame.header(header());
            frame.commandType(TYPE);
            return frame.buffer(os.toBuffer());
        } catch (IOException e) {
            throw new RuntimeException("The impossible happened");
        }
    }
View Full Code Here

            os.writeShort(messageId);
            os.write(grantedQos);

            MQTTFrame frame = new MQTTFrame();
            frame.commandType(TYPE);
            return frame.buffer(os.toBuffer());
        } catch (IOException e) {
            throw new RuntimeException("The impossible happened");
        }
    }
View Full Code Here

                MessageSupport.writeUTF(os, password);
            }

            MQTTFrame frame = new MQTTFrame();
            frame.commandType(TYPE);
            return frame.buffer(os.toBuffer());
        } catch (IOException e) {
            throw new RuntimeException("The impossible happened");
        }
    }
View Full Code Here

            os.writeShort(messageId);

            MQTTFrame frame = new MQTTFrame();
            frame.header(header());
            frame.commandType(TYPE);
            return frame.buffer(os.toBuffer());
        } catch (IOException e) {
            throw new RuntimeException("The impossible happened");
        }
    }
View Full Code Here

                DataByteArrayOutputStream os = new DataByteArrayOutputStream(2);
                os.writeShort(messageId);

                MQTTFrame frame = new MQTTFrame();
                frame.commandType(messageType());
                return frame.buffer(os.toBuffer());
            } catch (IOException e) {
                throw new RuntimeException("The impossible happened");
            }
        }
View Full Code Here

            }
            MQTTFrame frame = new MQTTFrame();
            frame.header(header());
            frame.commandType(TYPE);
            if(payload==null || payload.length==0) {
                frame.buffer(variableHeader.toBuffer());
            } else {
                frame.buffers(variableHeader.toBuffer(), payload);
            }
            return frame;
        } catch (IOException e) {
View Full Code Here

            frame.header(header());
            frame.commandType(TYPE);
            if(payload==null || payload.length==0) {
                frame.buffer(variableHeader.toBuffer());
            } else {
                frame.buffers(variableHeader.toBuffer(), payload);
            }
            return frame;
        } catch (IOException e) {
            throw new RuntimeException("The impossible happened");
        }
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.