[jboss-cvs] JBossAS SVN: r62175 - projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/metadata.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Apr 7 06:17:48 EDT 2007


Author: alesj
Date: 2007-04-07 06:17:48 -0400 (Sat, 07 Apr 2007)
New Revision: 62175

Modified:
   projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/metadata/AbstractManifestMetaData.java
Log:
read/write with Externalizable.

Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/metadata/AbstractManifestMetaData.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/metadata/AbstractManifestMetaData.java	2007-04-06 22:35:09 UTC (rev 62174)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/metadata/AbstractManifestMetaData.java	2007-04-07 10:17:48 UTC (rev 62175)
@@ -89,13 +89,68 @@
 
    public void writeExternal(ObjectOutput out) throws IOException
    {
-      OutputStream os = null; // todo
+      OutputStream os = new OutputWrapper(out);
       getManifest().write(os);
    }
 
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
    {
-      InputStream is = null; // todo
+      InputStream is = new InputWrapper(in);
       manifest = new Manifest(is);
    }
+
+   private class OutputWrapper extends OutputStream
+   {
+      private ObjectOutput out;
+
+      public OutputWrapper(ObjectOutput out)
+      {
+         this.out = out;
+      }
+
+      public void write(int b) throws IOException
+      {
+         out.write(b);
+      }
+
+      public void flush() throws IOException
+      {
+         out.flush();
+      }
+
+      public void close() throws IOException
+      {
+         out.close();
+      }
+   }
+
+   private class InputWrapper extends InputStream
+   {
+      private ObjectInput in;
+
+      public InputWrapper(ObjectInput in)
+      {
+         this.in = in;
+      }
+
+      public int read() throws IOException
+      {
+         return in.read();
+      }
+
+      public long skip(long n) throws IOException
+      {
+         return in.skip(n);
+      }
+
+      public int available() throws IOException
+      {
+         return in.available();
+      }
+
+      public void close() throws IOException
+      {
+         in.close();
+      }
+   }
 }




More information about the jboss-cvs-commits mailing list