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