On the front page of Kryo (http://code.google.com/p/kryo/), in the usage
examples, there is the following code.
ObjectBuffer buffer = new ObjectBuffer(kryo);
buffer.writeObject(someObject, new FileOutputStream("object.bin"));
someObject = buffer.readObject(new FileInputStream("object.bin"));
byte[] bytes = buffer.writeObject(someObject);
someObject = buffer.readObject(bytes);
However, in the documentation
(http://kryo.googlecode.com/svn/api/com/esotericsoftware/kryo/ObjectBuffer.html)
, the signature for writeObject is given as writeObject(OutputStream output,
Object object), the opposite of what is in the example. Furthermore, there does
not seem to be a one parameter version of readObject anymore.
I believe the correct example would be:
ObjectBuffer buffer = new ObjectBuffer(kryo);
buffer.writeObject(new FileOutputStream("object.bin"), someObject);
someObject = buffer.readObject(new FileInputStream("object.bin"),
someObject.getClass());
byte[] bytes = buffer.writeObject(someObject);
someObject = buffer.readObject(bytes);
Original issue reported on code.google.com by jeanfran...@gmail.com on 23 Mar 2012 at 4:04
Original issue reported on code.google.com by
jeanfran...@gmail.com
on 23 Mar 2012 at 4:04