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