use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.
the class MapMessageImpl method checkMap.
private void checkMap() {
if (map == null)
map = new MessageProperties();
if (mapBytes != null) {
try {
DataByteArrayInputStream dis = new DataByteArrayInputStream(mapBytes);
map.readContent(dis);
mapBytes = null;
} catch (IOException e) {
e.printStackTrace();
}
}
}
use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.
the class AuthResponseRequest 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) {
response = null;
} else {
try {
byte[] b = new byte[in.readInt()];
in.readFully(b);
response = (Serializable) (new ObjectInputStream(new DataByteArrayInputStream(b))).readObject();
} catch (ClassNotFoundException ignored) {
}
}
}
use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.
the class GetAuthChallengeReply 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) {
challenge = null;
} else {
try {
byte[] b = new byte[in.readInt()];
in.readFully(b);
challenge = (Serializable) (new ObjectInputStream(new DataByteArrayInputStream(b))).readObject();
} catch (ClassNotFoundException ignored) {
}
}
set = in.readByte();
if (set == 0) {
challengeResponseFactoryClass = null;
} else {
challengeResponseFactoryClass = in.readUTF();
}
}
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 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();
}
Aggregations