Class ObjectInputStreamWithClassLoader

java.lang.Object
java.io.InputStream
java.io.ObjectInputStream
com.clumd.projects.java_common_utils.base_enhancements.ObjectInputStreamWithClassLoader
All Implemented Interfaces:
Closeable, DataInput, ObjectInput, ObjectStreamConstants, AutoCloseable

public class ObjectInputStreamWithClassLoader extends ObjectInputStream
This is used to point to a provided custom classloader as the first point of contact for loading new objects over a connection. It also allows the caller to provide a custom overridden set of objects expected to be read from the InputStream when initialising
  • Constructor Details

    • ObjectInputStreamWithClassLoader

      public ObjectInputStreamWithClassLoader(@NonNull @NonNull InputStream in, @NonNull @NonNull URLClassLoader customLoader) throws IOException
      Custom constructor to include the classloader for the stream.
      Parameters:
      in - The inputStream as normal
      customLoader - The Custom Class loader to try first for all objects received over this stream.
      Throws:
      IOException - Thrown as per super's specification
  • Method Details