-
1. Re: Does JBossSerialization improves performance for Entrnai
clebert.suconic Feb 15, 2007 1:54 PM (in response to kumar_iitm)Why do you need to convert your object to bytes inside writeExternal?
Why not just use the DataOutput to write your data?
I would need an example to say more than that. -
2. Re: Does JBossSerialization improves performance for Entrnai
kumar_iitm Feb 15, 2007 2:38 PM (in response to kumar_iitm)As the DataOutputStream also writes the primitives by converting them into bytes and writing the bytes into stream, we thought of converting them ahead and writing the byteArray.
we use some thing like this
public byte[] convertInt(int value) {
return new byte[]{
(byte) (value >>> 24), (byte) (value >>> 16), (byte) (value >>> 8), (byte) (value >>> 0),
(byte) 0, (byte) 0, (byte) 0, (byte) 0};
}
and this byte[] we write into the stream in writeExternal() method.
public void writeExternal(final ObjectOutput out) throws IOException {
out.writeInt(this.aData.length);
out.write(this.aData);
}
This Externalizable object is a subclass of another parent object and we serialize that parent object like this.
PartenObject po = new ParentObject();
....setters
...
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
objectOutpuStream.writeObject(po);
But we see much overhead when we call this writeObject() method.
So are there any optimizations in Jboss Serialization in this redard.. -
3. Re: Does JBossSerialization improves performance for Entrnai
clebert.suconic Feb 15, 2007 3:00 PM (in response to kumar_iitm)I don't think this write(bytes[]) would be any different...
But you could give it a try with JBoss Serialization to see how it goes.