Search in sources :

Example 66 with DataByteArrayInputStream

use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.

the class ConnectReply method readContent.

public void readContent(DataInput in) throws IOException {
    super.readContent(in);
    routerName = in.readUTF();
    authRequired = in.readBoolean();
    if (authRequired) {
        crFactory = in.readUTF();
        byte[] b = new byte[in.readInt()];
        in.readFully(b);
        DataByteArrayInputStream dbis = new DataByteArrayInputStream(b);
        ObjectInputStream ois = new ObjectInputStream(dbis);
        try {
            challenge = (Serializable) ois.readObject();
        } catch (ClassNotFoundException e) {
            throw new IOException(e.toString());
        }
        ois.close();
    }
    leaseTimeout = in.readLong();
}
Also used : DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Example 67 with DataByteArrayInputStream

use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.

the class Versionable method toVersionable.

public static Versionable toVersionable(BytesMessage msg) throws Exception {
    byte[] b = new byte[(int) ((BytesMessageImpl) msg)._getBodyLength()];
    msg.readBytes(b);
    DataByteArrayInputStream dis = new DataByteArrayInputStream(b);
    Versionable v = new Versionable();
    v.readContent(dis);
    return v;
}
Also used : DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Example 68 with DataByteArrayInputStream

use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.

the class GenericRequest method readContent.

/**
 * Read the content of this object from the stream.
 *
 * @param in input stream
 * @throws IOException if an error occurs
 */
public void readContent(DataInput in) throws IOException {
    super.readContent(in);
    byte set = in.readByte();
    if (set == 0)
        payload = null;
    else {
        try {
            byte[] b = new byte[in.readInt()];
            in.readFully(b);
            payload = (Serializable) (new ObjectInputStream(new DataByteArrayInputStream(b))).readObject();
        } catch (ClassNotFoundException ignored) {
        }
    }
}
Also used : DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Aggregations

DataByteArrayInputStream (com.swiftmq.tools.util.DataByteArrayInputStream)68 InvalidSelectorException (javax.jms.InvalidSelectorException)22 ResourceLimitException (com.swiftmq.swiftlet.auth.ResourceLimitException)21 QueuePushTransaction (com.swiftmq.swiftlet.queue.QueuePushTransaction)21 RingBuffer (com.swiftmq.tools.collection.RingBuffer)21 JMSException (javax.jms.JMSException)21 MessageImpl (com.swiftmq.jms.MessageImpl)20 EntityList (com.swiftmq.mgmt.EntityList)15 List (java.util.List)15 InvalidDestinationException (javax.jms.InvalidDestinationException)14 TopicImpl (com.swiftmq.jms.TopicImpl)8 QueueImpl (com.swiftmq.jms.QueueImpl)7 DataByteArrayOutputStream (com.swiftmq.tools.util.DataByteArrayOutputStream)7 IOException (java.io.IOException)7 com.swiftmq.jms (com.swiftmq.jms)2 AddressString (com.swiftmq.amqp.v100.generated.messaging.message_format.AddressString)1 MessageFormat (com.swiftmq.amqp.v100.generated.transport.definitions.MessageFormat)1 CountableBufferedInputStream (com.swiftmq.impl.net.netty.CountableBufferedInputStream)1 CountableWrappedOutputStream (com.swiftmq.impl.net.netty.CountableWrappedOutputStream)1 BytesMessageImpl (com.swiftmq.jms.BytesMessageImpl)1