Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.io   Previous This
Package
Next

 


Class ObjectInputStreamWithLoader

public class ObjectInputStreamWithLoader extends ObjectInputStream
{
  // Constructors
  public ObjectInputStreamWithLoader(InputStream in,
        ClassLoader loader) throws IOException,
        StreamCorruptedException;

  // Methods
  protected Class resolveClass(ObjectStreamClass classDesc)
        throws IOException, ClassNotFoundException;
}

This class provides methods that allow a class to be resolved by using an existing ClassLoader instance instead of the system class loader. It extends the java.io.ObjectInputStream class, which delegates class resolution to the java.lang.ClassLoader supplied at construction time.

ObjectInputStream
  |
  +--ObjectInputStreamWithLoader

Constructors

ObjectInputStreamWithLoader

public ObjectInputStreamWithLoader(InputStream in,
        ClassLoader loader) throws IOException, StreamCorruptedException;

Creates an ObjectInputStreamWithLoader object, using the specified input stream and class loader.

ParameterDescription
in The input stream that is used to create the object.
loader The existing ClassLoader instance.

Exceptions:

IllegalArgumentException if loader is null.

IOException if an error is encountered while using the underlying stream.

StreamCorruptedException if the version or magic number is incorrect.

Methods

resolveClass

protected Class resolveClass(ObjectStreamClass classDesc)
        throws IOException, ClassNotFoundException;

Instructs the class loader that is associated with the ObjectInputStreamWithLoader object to load the class indicated by the specified ObjectStreamClass object.

Return Value:

Returns the loaded class.

ParameterDescription
classDesc The ObjectStreamClass object that indicates the class to load.

Exceptions:

ClassNotFoundException if the class to load cannot be found.

IOException if the loader encounters an error while reading the class.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.