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();
}
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();
}
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();
}
}
}
}
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;
}
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);
}
}
Aggregations