1 };
for (int i = 0; i < numberValues.length; i++) {
long value = numberValues[i];
SessionId object = new SessionId();
object.setConnectionId(connectionId);
object.setValue(value);
writeObject(object);
}
ds.writeInt(endOfStreamMarker);
// now lets read from the stream
ds.close();
ByteArrayInputStream in = new ByteArrayInputStream(buffer.toByteArray());
DataInputStream dis = new DataInputStream(in);
for (int i = 0; i < numberValues.length; i++) {
long value = numberValues[i];
String expected = Long.toHexString(value);
log.info("Unmarshaling value: " + i + " = " + expected);
SessionId command = (SessionId) openWireformat.unmarshal(dis);
assertEquals("connection ID in object: "+ i, connectionId, command.getConnectionId());
String actual = Long.toHexString(command.getValue());
assertEquals("value of object: "+ i + " was: " + actual, expected, actual);
}
int marker = dis.readInt();
assertEquals("Marker int", Integer.toHexString(endOfStreamMarker), Integer.toHexString(marker));