How can i convert object to byte array very*100 fast?
843829May 18 2009 — edited May 19 2009i need to transfer a object by datagram packet in embeded system.
i make a code fallowing sequence.
1) convert object to byte array ( i append object attribute to byte[] sequencailly )
2) send the byte array by datagram packet ( by JNI )
but, it's not satisfied my requirement.
it must be finished in 1ms.
but, converting is spending 2ms.
network speed is not bottleneck. ( transfer time is 0.3ms and packet size is 4096 bytes )
Using ObjectOutputStream is very slow, so i'm using this way.
is there antoher way? or how can i improve?
Edited by: JongpilKim on May 17, 2009 10:48 PM
Edited by: JongpilKim on May 17, 2009 10:51 PM
Edited by: JongpilKim on May 17, 2009 10:53 PM