Examples of toBuffer()


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

                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

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

            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

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

                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

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

            }
            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

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

            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

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

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

                buffer.write(current.data.getData(), current.data.getOffset(), current.data.getLength());
                latest = current;
            }

            // Now we can fill in the batch control record properly.
            Buffer sequence = buffer.toBuffer();
            buffer.reset();
            buffer.skip(Journal.HEADER_SIZE);
            buffer.writeInt(sequence.getLength() - Journal.HEADER_SIZE - Journal.BATCH_SIZE);
            buffer.skip(Journal.BATCH_CONTROL_RECORD_MAGIC.length);
            if (checksum) {
View Full Code Here

Examples of org.fusesource.hawtdb.util.buffer.DataByteArrayOutputStream.toBuffer()

    private Marshaller<DefaultExchangeHolder> exchangeMarshaller = new ObjectMarshaller<DefaultExchangeHolder>();

    public Buffer marshallKey(String key) throws IOException {
        DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
        keyMarshaller.writePayload(key, baos);
        return baos.toBuffer();
    }

    public String unmarshallKey(Buffer buffer) throws IOException {
        DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
        String key = keyMarshaller.readPayload(bais);
View Full Code Here

Examples of org.fusesource.hawtdb.util.buffer.DataByteArrayOutputStream.toBuffer()

        // persist the from endpoint as well
        if (exchange.getFromEndpoint() != null) {
            DefaultExchangeHolder.addProperty(pe, "CamelAggregatedFromEndpoint", exchange.getFromEndpoint().getEndpointUri());
        }
        exchangeMarshaller.writePayload(pe, baos);
        return baos.toBuffer();
    }

    public Exchange unmarshallExchange(CamelContext camelContext, Buffer buffer) throws IOException {
        DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
        DefaultExchangeHolder pe = exchangeMarshaller.readPayload(bais);
View Full Code Here

Examples of org.gwtnode.dev.debug.message.Message.toBuffer()

                        proxyStream.append(buffer);
                        Message message;
                        do {
                            message = logMessage(proxyStream, true);
                            if (message != null) {
                                gwtCodeSocket.write(message.toBuffer());
                            }
                        } while (message != null);
                        //gwtCodeSocket.write(buffer);
                    }
                });
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.