Examples of toByteSequence()


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

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

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

        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, this.text);
            dataOut.close();
            setContent(bytesOut.toByteSequence());
            //see https://issues.apache.org/activemq/browse/AMQ-2103
            this.text=null;
        }
    }
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.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()

  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.DataByteArrayOutputStream.toByteSequence()

    }

    public StoreLocation storeDataItem(Marshaller marshaller, Object payload) throws IOException {
        final DataByteArrayOutputStream buffer = new DataByteArrayOutputStream();
        marshaller.writePayload(payload, buffer);
        ByteSequence data = buffer.toByteSequence();
        return convertToStoreLocation(dataManager.write(data, (byte)1, false));
    }

    public void force() throws IOException {
        dataManager.write(FORCE_COMMAND, (byte)2, true);
View Full Code Here

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

    }

    public void updateItem(StoreLocation location, Marshaller marshaller, Object payload) throws IOException {
        final DataByteArrayOutputStream buffer = new DataByteArrayOutputStream();
        marshaller.writePayload(payload, buffer);
        ByteSequence data = buffer.toByteSequence();
        dataManager.update(convertFromStoreLocation(location), data, false);
    }

    public void close() throws IOException {
        dataManager.close();
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.