Description
Calling AvroUtils.deepClonePersistent on a smallish object (e.g. an unfetched Nutch WebPage) results in the following exception:
java.lang.RuntimeException: Unable to deserialize avro object from byte buffer - please report this issue to the Gora bugtracker or your administrator. at org.apache.gora.util.AvroUtils.deepClonePersistent(AvroUtils.java:125)
The method clones its argument by writing it to a wrapped byte array and deserializing it from there. However, the output is buffered in the BinaryEncoder and doesn't appear in the OutputStream. Adding enc.flush() after writer.write seems to fix the bug.
The attached patch contains a test that demonstrates the bug.