final Object[] testArray = { "test1", "test2", "test3" };
final String[] testStringArray = { "test1", "test2", "test3", "test4" };
final byte[] testBytes = new byte[] {1,2,3,4,5,6,7,8,9,10};
final Integer testInteger = new Integer(10);
final byte[] bigByteArray = new byte[1024];
final BoxedPrimitive testBp = new BoxedPrimitive(100L);
final float[] floats = new float[1000];
final Dictionary dict = new Hashtable();
dict.put("test1", new Integer(10));
dict.put("test2", "value");
// serialize
SmartSerializer.serialize(testString, out);
SmartSerializer.serialize(testArray, out);
SmartSerializer.serialize(testStringArray, out);
SmartSerializer.serialize(testBytes, out);
SmartSerializer.serialize(testInteger, out);
SmartSerializer.serialize(bigByteArray, out);
SmartSerializer.serialize(testBp, out);
SmartSerializer.serialize(floats, out);
SmartSerializer.serialize(dict, out);
out.flush();
final ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bout.toByteArray()));
assertEquals(testString, SmartSerializer.deserialize(in));
assertArrayEquals(testArray, (Object[]) SmartSerializer.deserialize(in));
assertArrayEquals(testStringArray, (String[]) SmartSerializer.deserialize(in));
assertByteArrayEquals(testBytes, (byte[]) SmartSerializer.deserialize(in));
assertEquals(testInteger, SmartSerializer.deserialize(in));
assertByteArrayEquals(bigByteArray, (byte[]) SmartSerializer.deserialize(in));
assertEquals(testBp.getBoxed(), SmartSerializer.deserialize(in));
assertFloatArrayEquals(floats, (float[]) SmartSerializer.deserialize(in));
assertEquals(dict, (Dictionary) SmartSerializer.deserialize(in));
}