This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: Array serialization
- To: Java Patch List <java-patches at sourceware dot cygnus dot com>
- Subject: Patch: Array serialization
- From: Warren Levy <warrenl at cygnus dot com>
- Date: Wed, 24 May 2000 14:15:10 -0700 (PDT)
Folks,
Here's a patch to get basic serialization of arrays working. Enjoy!
--warrenl
2000-05-24 Warren Levy <warrenl@cygnus.com>
* java/io/ObjectOutputStream.java (writeObject): Use component type
when writing arrays.
Fixed typo.
Index: java/io/ObjectOutputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/io/ObjectOutputStream.java,v
retrieving revision 1.1
diff -u -p -r1.1 ObjectOutputStream.java
--- ObjectOutputStream.java 2000/05/19 17:55:31 1.1
+++ ObjectOutputStream.java 2000/05/24 21:12:30
@@ -1,5 +1,5 @@
/* ObjectOutputStream.java -- Class used to write serialized objects
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -276,7 +276,7 @@ public class ObjectOutputStream extends
realOutput.writeByte (TC_ARRAY);
writeObject (osc);
assignNewHandle (obj);
- writeArraySizeAndElements (obj, clazz);
+ writeArraySizeAndElements (obj, clazz.getComponentType ());
break;
}
@@ -395,7 +395,7 @@ public class ObjectOutputStream extends
throw new NotActiveException ("defaultWriteObject called by
non-active class and/or object");
if (fieldsAlreadyWritten)
- throw new IOException ("Only one of putFields and
defalutWriteObject may be called, and it may only be called once");
+ throw new IOException ("Only one of putFields and
defaultWriteObject may be called, and it may only be called once");
fieldsAlreadyWritten = true;
}