Search in sources :

Example 1 with WhiteListObjectInputStream

use of com.rabbitmq.jms.util.WhiteListObjectInputStream in project rabbitmq-jms-client by rabbitmq.

the class RMQObjectMessage method getObject.

public Serializable getObject(List<String> trustedPackages) throws JMSException {
    if (buf == null) {
        return null;
    } else {
        this.loggerDebugByteArray("Deserialising object from buffer {} for {}", this.buf, "RMQObjectMessage");
        ByteArrayInputStream bin = new ByteArrayInputStream(buf);
        try {
            WhiteListObjectInputStream in = new WhiteListObjectInputStream(bin, trustedPackages);
            return (Serializable) in.readObject();
        } catch (ClassNotFoundException x) {
            throw new RMQJMSException(x);
        } catch (IOException x) {
            throw new RMQJMSException(x);
        }
    }
}
Also used : Serializable(java.io.Serializable) RMQJMSException(com.rabbitmq.jms.util.RMQJMSException) ByteArrayInputStream(java.io.ByteArrayInputStream) WhiteListObjectInputStream(com.rabbitmq.jms.util.WhiteListObjectInputStream) IOException(java.io.IOException)

Aggregations

RMQJMSException (com.rabbitmq.jms.util.RMQJMSException)1 WhiteListObjectInputStream (com.rabbitmq.jms.util.WhiteListObjectInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 Serializable (java.io.Serializable)1