Class ExpectedObjectInputStream

java.lang.Object
java.io.InputStream
java.io.ObjectInputStream
org.owasp.dependencycheck.utils.ExpectedObjectInputStream
All Implemented Interfaces:
Closeable, DataInput, ObjectInput, ObjectStreamConstants, AutoCloseable

public class ExpectedObjectInputStream extends ObjectInputStream
An ObjectInputStream that will only deserialize expected classes.
Version:
$Id: $Id
Author:
Jeremy Long
  • Constructor Details

    • ExpectedObjectInputStream

      public ExpectedObjectInputStream(InputStream inputStream, String... expected) throws IOException
      Constructs a new ExpectedOjectInputStream that can be used to securely deserialize an object by restricting the classes that can deserialized to a known set of expected classes.
      Parameters:
      inputStream - the input stream that contains the object to deserialize
      expected - the fully qualified class names of the classes that can be deserialized
      Throws:
      IOException - thrown if there is an error reading from the stream
  • Method Details