Search in sources :

Example 56 with DataByteArrayInputStream

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

the class AuthRequest method readContent.

public void readContent(DataInput input) throws IOException {
    super.readContent(input);
    byte[] b = new byte[input.readInt()];
    input.readFully(b);
    DataByteArrayInputStream dbis = new DataByteArrayInputStream(b);
    ObjectInputStream ois = new ObjectInputStream(dbis);
    try {
        response = (Serializable) ois.readObject();
    } catch (ClassNotFoundException e) {
        throw new IOException(e.toString());
    }
    ois.close();
}
Also used : DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Example 57 with DataByteArrayInputStream

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

the class ConnectReplyRequest method readContent.

public void readContent(DataInput input) throws IOException {
    super.readContent(input);
    routerName = input.readUTF();
    authRequired = input.readBoolean();
    if (authRequired) {
        crFactory = input.readUTF();
        byte[] b = new byte[input.readInt()];
        input.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();
    }
    keepAliveInterval = input.readLong();
    requestXA = input.readBoolean();
}
Also used : DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Example 58 with DataByteArrayInputStream

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

the class MessageImpl method checkProps.

private void checkProps() {
    if (props == null) {
        props = new MessageProperties();
        if (propBytes != null) {
            try {
                DataByteArrayInputStream dis = new DataByteArrayInputStream(propBytes);
                props.readContent(dis);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
Also used : IOException(java.io.IOException) DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Example 59 with DataByteArrayInputStream

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

the class ObjectMessageImpl method deserialize.

private Serializable deserialize(byte[] b, ClassLoader loader) throws IOException, ClassNotFoundException {
    DataByteArrayInputStream bis = new DataByteArrayInputStream(b);
    ObjectInputStream ois = new SecureClassLoaderObjectInputStream(loader == null ? bis : bis, loader);
    Serializable obj = (Serializable) ois.readObject();
    ois.close();
    return obj;
}
Also used : SecureClassLoaderObjectInputStream(com.swiftmq.tools.security.SecureClassLoaderObjectInputStream) DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream) SecureClassLoaderObjectInputStream(com.swiftmq.tools.security.SecureClassLoaderObjectInputStream)

Example 60 with DataByteArrayInputStream

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

the class BytesMessageImpl method checkRead.

private void checkRead() {
    if (dis == null) {
        dos = null;
        byte[] b = null;
        if (array != null && cnt > 0) {
            b = array;
        } else
            b = new byte[0];
        dis = new DataByteArrayInputStream(b);
    }
}
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