Examples of toByteSequence()


Examples of org.apache.activemq.store.kahadb.disk.util.DataByteArrayOutputStream.toByteSequence()

                }

                final DataByteArrayOutputStream buff = wb.buff;
                final boolean forceToDisk = wb.forceToDisk;

                ByteSequence sequence = buff.toByteSequence();
               
                // Now we can fill in the batch control record properly.
                buff.reset();
                buff.skip(5+Journal.BATCH_CONTROL_RECORD_MAGIC.length);
                buff.writeInt(sequence.getLength()-Journal.BATCH_CONTROL_RECORD_SIZE);
View Full Code Here

Examples of org.apache.activemq.util.ByteArrayOutputStream.toByteSequence()

        if (marshalledProperties == null && properties != null) {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            DataOutputStream os = new DataOutputStream(baos);
            MarshallingSupport.marshalPrimitiveMap(properties, os);
            os.close();
            marshalledProperties = baos.toByteSequence();
        }
    }

    public void afterMarshall(WireFormat wireFormat) throws IOException {
    }
View Full Code Here

Examples of org.apache.activemq.util.ByteArrayOutputStream.toByteSequence()

        if (marshalledProperties == null && properties != null) {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            DataOutputStream os = new DataOutputStream(baos);
            MarshallingSupport.marshalPrimitiveMap(properties, os);
            os.close();
            marshalledProperties = baos.toByteSequence();
        }
    }

    public void afterMarshall(WireFormat wireFormat) throws IOException {
    }
View Full Code Here

Examples of org.apache.activemq.util.ByteArrayOutputStream.toByteSequence()

                os = new DeflaterOutputStream(os);
            }
            DataOutputStream dataOut = new DataOutputStream(os);
            MarshallingSupport.writeUTF8(dataOut, text);
            dataOut.close();
            setContent(bytesOut.toByteSequence());
        }
    }

    /**
     * Clears out the message body. Clearing a message's body does not clear its
View Full Code Here

Examples of org.apache.activemq.util.ByteArrayOutputStream.toByteSequence()

                    ByteArrayOutputStream baos = new ByteArrayOutputStream(connection.getContentLength() > 0 ? connection.getContentLength() : 1024);
                    int c = 0;
                    while ((c = is.read()) >= 0) {
                        baos.write(c);
                    }
                    ByteSequence sequence = baos.toByteSequence();
                    String data = new String(sequence.data, sequence.offset, sequence.length, "UTF-8");

                    Command command = (Command)getTextWireFormat().unmarshalText(data);

                    if (command == null) {
View Full Code Here

Examples of org.apache.activemq.util.ByteArrayOutputStream.toByteSequence()

                    os = new DeflaterOutputStream(os);
                }
                DataOutputStream dataOut = new DataOutputStream(os);
                MarshallingSupport.marshalPrimitiveMap(map, dataOut);
                dataOut.close();
                setContent(bytesOut.toByteSequence());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.apache.activemq.util.ByteArrayOutputStream.toByteSequence()

                os = new DeflaterOutputStream(os);
            }
            DataOutputStream dataOut = new DataOutputStream(os);
            MarshallingSupport.writeUTF8(dataOut, this.text);
            dataOut.close();
            setContent(bytesOut.toByteSequence());
        }
    }

    // see https://issues.apache.org/activemq/browse/AMQ-2103
    // and https://issues.apache.org/activemq/browse/AMQ-2966
View Full Code Here

Examples of org.apache.activemq.util.ByteArrayOutputStream.toByteSequence()

        if (marshalledProperties == null && properties != null) {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            DataOutputStream os = new DataOutputStream(baos);
            MarshallingSupport.marshalPrimitiveMap(properties, os);
            os.close();
            marshalledProperties = baos.toByteSequence();
        }
    }

    public void afterMarshall(WireFormat wireFormat) throws IOException {
    }
View Full Code Here

Examples of org.apache.activemq.util.ByteArrayOutputStream.toByteSequence()

    protected void setContent(Message message, String text) throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream dataOut = new DataOutputStream(baos);
        MarshallingSupport.writeUTF8(dataOut, text);
        dataOut.close();
        message.setContent(baos.toByteSequence());
    }
}
View Full Code Here

Examples of org.apache.activemq.util.ByteArrayOutputStream.toByteSequence()

    public ByteSequence marshal(Object command) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(baos);
        marshal(command, dos);
        dos.close();
        return baos.toByteSequence();
    }

    public Object unmarshal(ByteSequence packet) throws IOException {
        ByteArrayInputStream stream = new ByteArrayInputStream(packet);
        DataInputStream dis = new DataInputStream(stream);
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.