2001 JI Open Discussion Posted August 14, 2006 Share Posted August 14, 2006 By: John Pollard - johnnypoll Serialize/Deserialize problem 2002-05-08 02:22As I generate reports on a server and pass the results to a client I must serialize and deserialize the JasperPrint object. Once deserialized, newline characters have been damaged; when viewing the report I can see little squares and no line break where the newline character was. Prior to serializing the JasperPrint it views ok. Here is how I serialize and deserialize it: ByteArrayOutputStream out = new ByteArrayOutputStream(); ObjectOutputStream objectOut = new ObjectOutputStream(out); objectOut.writeObject(jasperPrint); ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); ObjectInputStream objectIn = new ObjectInputStream(in); JasperPrint jasperPrint = (JasperPrint) objectIn.readObject(); Is there any workaround to this problem; could I do some kind of substitution on the bytes to correct the newlines before (or after) deserializing? Thanks John Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now