The code snippets with the TestObject are provided below. Please
advise.
Regards,
-Prasad
public static Object readObjectFromStream(InputStream is) {
try {
ObjectBuffer objBuffer = new ObjectBuffer(KRYO, 1024,
32*1024);
return objBuffer.readClassAndObject(is);
} finally {
is.close();
}
}
public static void writeObjectToStream(Object object, OutputStream os)
{
try {
ObjectBuffer objBuffer = new ObjectBuffer(KRYO, 1024,
32*1024);
objBuffer.writeClassAndObject(os, object);
} finally {
os.close();
}
}
public class SerializableTestObject implements Serializable
{
private boolean valid = true;
private int id = Integer.MIN_VALUE;
private Long Id = Long.valueOf(Long.MAX_VALUE);
// private BigInteger ID = BigInteger.TEN;
private float value = Float.MIN_NORMAL;
private Double Value = Double.valueOf(Double.MIN_NORMAL);
// private BigDecimal VALUE = BigDecimal.TEN;
private Date date = new Date();
// private Timestamp time = new Timestamp(System.currentTimeMillis());
private TestCcy ccy = TestCcy.USD;
static enum TestCcy {
EUR,
GBP,
USD,
JPY,
INR
}
}
--
You received this message because you are subscribed to the "kryo-users" group.
http://groups.google.com/group/kryo-users
To unsubscribe from this group, send email to kryo-users+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Thanks for the quick response. My browser thew an error while posting
and I had assumed the post didn't go through. Meanwhile, I figured
that Kryo comes with BigInteger and BigDecimal Serializers. I had also
written my own SqlDate, SqlTime, SqlTimestamp serializers.
Also, I have some question regarding overriding DefaultSerializer and
I'm posting it as a new thread to make the Subject clear.
Thanks,
-Prasad
On Mar 24, 6:51 pm, Nate <nathan.sw...@gmail.com> wrote:
> Hi Prasad,
>
> I've adapted the code you posted as a unit test for ObjectBuffer in r81:http://code.google.com/p/kryo/source/browse/trunk/test/com/esotericso...