2362N/A * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A // ** Preserving reference semantics. 0N/A // if (obj already serialized) { 0N/A // look up streamId for obj and write it into 'this' stream. 0N/A // if (obj instanceof Class) { 0N/A // //Special processing for classes. 0N/A // //Might need to call this.annotateClass(obj.getClass()) 0N/A // **Replacement semantics 0N/A // Object replacement = obj; 0N/A // if (enableReplace) 0N/A // replacement = this.writeReplace(obj); 0N/A // if (replacement instanceof Replaceable) 0N/A // replacement = ((Replaceable)replacement).replaceObject(this); 0N/A // if (obj != replacement) { 0N/A // //record that all future occurances of obj should be replaced 0N/A // //with replacement 0N/A // if obj is Externalizeable { 0N/A // Object[] argList = {this}; 0N/A // invokeMethod(obj, writeExternalMethod, argList); 0N/A /* Since defaultWriteObject() does not take the object to write as a parameter, 0N/A * implementation is required to store currentObject when writeObject is called. 0N/A //In order to access package, private and protected fields, 0N/A //one needs to use Priviledged Access and be trusted code. 0N/A //This test will avoid that problem by only serializing public fields. 0N/A //Skip non-Serializable fields. 0N/A * Put the value of the named boolean field into the persistent field. 0N/A * Put the value of the named char field into the persistent fields. 0N/A * Put the value of the named byte field into the persistent fields. 0N/A * Put the value of the named short field into the persistent fields. 0N/A * Put the value of the named int field into the persistent fields. 0N/A * Put the value of the named long field into the persistent fields. 0N/A * Put the value of the named float field into the persistent fields. 0N/A * Put the value of the named double field into the persistent field. 0N/A * Put the value of the named Object field into the persistent field. 0N/A * Write the data and fields to the specified ObjectOutput stream. 0N/A * Writes a byte. This method will block until the byte is actually 0N/A * @exception IOException If an I/O error has occurred. 0N/A * Writes an array of bytes. This method will block until the bytes 0N/A * are actually written. 0N/A * @param b the data to be written 0N/A * @exception IOException If an I/O error has occurred. 0N/A * Writes a sub array of bytes. 0N/A * @param b the data to be written 0N/A * @param off the start offset in the data 0N/A * @param len the number of bytes that are written 0N/A * @exception IOException If an I/O error has occurred. 0N/A /********************************************************************/ 0N/A /* CODE LIFTED FROM ObjectStreamClass constuctor. 0N/A * ObjectStreamClass.writeObjectMethod is private. 0N/A * Look for the writeObject method 0N/A * Set the accessible flag on it here. 0N/A * Subclass of AbstractObjectOutputStream will call it as necessary. 0N/A // Method must be private and non-static 0N/A /*************************************************************/ 0N/A /* CODE LIFTED FROM ObjectOutputStream. */ 0N/A // IllegalAccessException cannot happen