mbeckerle commented on a change in pull request #161: Make the JAPI/SAPI
DataProcessors serializable
URL: https://github.com/apache/incubator-daffodil/pull/161#discussion_r245372700
##########
File path:
daffodil-japi/src/test/java/org/apache/daffodil/example/TestJavaAPI.java
##########
@@ -59,8 +61,34 @@
}
}
+ public DataProcessor reserializeDataProcessor(DataProcessor dp) throws
IOException, ClassNotFoundException {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(dp);
+ oos.close();
+
+ ByteArrayInputStream bais = new
ByteArrayInputStream(baos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bais) {
+ /**
Review comment:
This comment perhaps belongs on the method signature above.
Can you please explain more why we're having to do more here than just
inherit from Serializable?
Is there a maintenance burden here, like all our serializable base classes
have to manually call this reserialize thing?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services