Examples of CustomObjectOutputStream


Examples of com.thoughtworks.xstream.core.util.CustomObjectOutputStream

                        mustHandleUnserializableParent = false;
                    }
                    if (serializationMethodInvoker.supportsWriteObject(currentType[0], false)) {
                        writtenClassWrapper[0] = true;
                        writer.startNode(mapper.serializedClass(currentType[0]));
                        CustomObjectOutputStream objectOutputStream = CustomObjectOutputStream.getInstance(context, callback);
                        serializationMethodInvoker.callWriteObject(currentType[0], source, objectOutputStream);
                        objectOutputStream.popCallback();
                        writer.endNode();
                    } else if (serializationMethodInvoker.supportsReadObject(currentType[0], false)) {
                        // Special case for objects that have readObject(), but not writeObject().
                        // The class wrapper is always written, whether or not this class in the hierarchy has
                        // serializable fields. This guarantees that readObject() will be called upon deserialization.
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.CustomObjectOutputStream

     */
    public ObjectOutputStream createObjectOutputStream(
            final HierarchicalStreamWriter writer, String rootNodeName) throws IOException {
        final StatefulWriter statefulWriter = new StatefulWriter(writer);
        statefulWriter.startNode(rootNodeName, null);
        return new CustomObjectOutputStream(new CustomObjectOutputStream.StreamCallback() {
            public void writeToStream(Object object) {
                marshal(object, statefulWriter);
            }

            public void writeFieldsToStream(Map fields) throws NotActiveException {
View Full Code Here

Examples of org.jboss.util.stream.CustomObjectOutputStream

    */
   public static byte[] toByteArray(Object obj)
   {
      try {
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         ObjectOutputStream oos = new CustomObjectOutputStream(os);

         oos.writeObject(obj);
         oos.flush();
         byte[] a = os.toByteArray();
         os.close();
         return a;
      }
      catch (IOException ioe) {
View Full Code Here

Examples of org.jboss.util.stream.CustomObjectOutputStream

/*    */   public static byte[] toByteArray(Object obj)
/*    */   {
/*    */     try
/*    */     {
/* 47 */       ByteArrayOutputStream os = new ByteArrayOutputStream();
/* 48 */       ObjectOutputStream oos = new CustomObjectOutputStream(os);
/*    */
/* 50 */       oos.writeObject(obj);
/* 51 */       oos.flush();
/* 52 */       byte[] a = os.toByteArray();
/* 53 */       os.close();
/* 54 */       return a;
/*    */     } catch (IOException ioe) {
/*    */     }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.