Examples of toByteSequence()


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()

        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()

                ObjectOutputStream objOut = new ObjectOutputStream(dataOut);
                objOut.writeObject(object);
                objOut.flush();
                objOut.reset();
                objOut.close();
                setContent(bytesOut.toByteSequence());
            } catch (IOException ioe) {
                throw new RuntimeException(ioe.getMessage(), ioe);
            }
        }
    }
View Full Code Here

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

                    //text.setText(new String(command.getContent(), "UTF-8"));
                    ByteArrayOutputStream bytes = new ByteArrayOutputStream(command.getContent().length + 4);
                    DataOutputStream data = new DataOutputStream(bytes);
                    data.writeInt(command.getContent().length);
                    data.write(command.getContent());
                    text.setContent(bytes.toByteSequence());
                } catch (Throwable e) {
                    throw new ProtocolException("Text could not bet set: " + e, false, e);
                }
                msg = text;
            } else if(intendedType.equalsIgnoreCase("bytes")) {
View Full Code Here

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

                //text.setText(new String(command.getContent(), "UTF-8"));
                ByteArrayOutputStream bytes = new ByteArrayOutputStream(command.getContent().length + 4);
                DataOutputStream data = new DataOutputStream(bytes);
                data.writeInt(command.getContent().length);
                data.write(command.getContent());
                text.setContent(bytes.toByteSequence());
            } catch (Throwable e) {
                throw new ProtocolException("Text could not bet set: " + e, false, e);
            }
            msg = text;
        }
View Full Code Here

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

            int read;
            ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
            while ((read = inflater.inflate(data, 0, data.length)) != 0) {
                bytesOut.write(data, 0, read);
            }
            byteSequence = bytesOut.toByteSequence();
        }

        if (message.getDataStructureType() == ActiveMQTextMessage.DATA_STRUCTURE_TYPE) {
            if (byteSequence.getLength() > 4) {
                byte[] content = new byte[byteSequence.getLength() - 4];
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

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

                throw new ProtocolException(errorMessage, true);
            }
            baos.write(b);
        }
        baos.close();
        return baos.toByteSequence();
    }

    protected String parseAction(DataInput in) throws IOException {
        String action = null;
View Full Code Here

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

                        } else {
                            break;
                        }
                    }

                    ByteSequence nameSeq = stream.toByteSequence();
                    String name = new String(nameSeq.getData(), nameSeq.getOffset(), nameSeq.getLength(), "UTF-8").trim();
                    String value = decodeHeader(headerLine);
                    headers.put(name, value);
                } catch (Exception e) {
                    throw new ProtocolException("Unable to parser header line [" + line + "]", true);
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.