Package org.apache.activemq.util

Examples of org.apache.activemq.util.ByteArrayInputStream


        dos.close();
        return baos.toByteSequence();
    }

    public Object unmarshal(ByteSequence packet) throws IOException {
        ByteArrayInputStream stream = new ByteArrayInputStream(packet);
        DataInputStream dis = new DataInputStream(stream);
        return unmarshal(dis);
    }
View Full Code Here


    public String getText() throws JMSException {
        if (text == null && getContent() != null) {
            try {
                ByteSequence bodyAsBytes = getContent();
                if (bodyAsBytes != null) {
                    InputStream is = new ByteArrayInputStream(bodyAsBytes);
                    if( isCompressed() ) {
                        is = new InflaterInputStream(is);
                    }
                    DataInputStream dataIn = new DataInputStream(is);
                    text = MarshallingSupport.readUTF8(dataIn);
View Full Code Here

   
    /**
     * @see org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter#setBinaryData(java.sql.PreparedStatement, int, byte[])
     */
    protected void setBinaryData(PreparedStatement s, int index, byte[] data) throws SQLException {
        s.setBinaryStream(index, new ByteArrayInputStream(data), data.length);
    }
View Full Code Here

            }
        }
    }
   
    private Map unmarsallProperties(ByteSequence marshalledProperties) throws IOException {
        return MarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new ByteArrayInputStream(marshalledProperties)), MAX_PROPERTY_SIZE);
    }
View Full Code Here

            }
        }
    }
   
    private Map unmarsallProperties(ByteSequence marshalledProperties) throws IOException {
        return MarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new ByteArrayInputStream(marshalledProperties)));
    }
View Full Code Here

     */
    public Serializable getObject() throws JMSException {
        if (object == null && getContent()!=null ) {
            try {
                ByteSequence content = getContent();
                InputStream is = new ByteArrayInputStream(content);
                if( isCompressed() ) {
                    is = new InflaterInputStream(is);
                }
                DataInputStream dataIn = new DataInputStream(is);
                ClassLoadingAwareObjectInputStream objIn = new ClassLoadingAwareObjectInputStream(dataIn);
View Full Code Here

        checkWriteOnlyBody();
        if (dataIn == null ) {
            ByteSequence data = getContent();
            if( data==null )
                data = new ByteSequence(new byte[]{}, 0, 0);
            InputStream is = new ByteArrayInputStream(data);
            if( isCompressed() ) {
                // keep track of the real length of the content if
                // we are compressed.
                try {
                    DataInputStream dis = new DataInputStream(is);
View Full Code Here

            }
            if (type == LastPartialCommand.DATA_STRUCTURE_TYPE) {
                try {
                    byte[] fullData = out.toByteArray();
                    out.reset();
                    DataInputStream dataIn = new DataInputStream(new ByteArrayInputStream(fullData));
                    Command completeCommand = (Command) wireFormat.unmarshal(dataIn);

                    LastPartialCommand lastCommand = (LastPartialCommand) command;
                    lastCommand.configure(completeCommand);
View Full Code Here

        ds.close();
        return baos.toByteSequence();
    }

    public Object unmarshal(ByteSequence packet) throws IOException {
        return unmarshal(new DataInputStream(new ByteArrayInputStream(packet)));
    }
View Full Code Here

                DatagramPacket datagram = createDatagramPacket();
                channel.receive(datagram);

                // TODO could use a DataInput implementation that talks direct
                // to the byte[] to avoid object allocation
                DataInputStream dataIn = new DataInputStream(new ByteArrayInputStream(datagram.getData()));

                from = headerMarshaller.createEndpoint(datagram, dataIn);
                answer = (Command) wireFormat.unmarshal(dataIn);
                break;
            }
View Full Code Here

TOP

Related Classes of org.apache.activemq.util.ByteArrayInputStream

Copyright © 2018 www.massapicom. 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.