Class PomProjectInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.owasp.dependencycheck.xml.pom.PomProjectInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class PomProjectInputStream extends FilterInputStream
Filters everything in an input stream prior to the <project> element. This is useful to filter out the DOCTYPE declarations that can cause parsing issues.
Author:
Jeremy Long
  • Field Details

    • BUFFER_SIZE

      protected static final int BUFFER_SIZE
      The size of the buffer used to scan the input stream.
      See Also:
  • Constructor Details

    • PomProjectInputStream

      public PomProjectInputStream(InputStream in) throws IOException
      Constructs a new POM project filtering input stream. The input stream is wrapped in a buffered input stream.
      Parameters:
      in - the input stream
      Throws:
      IOException - thrown if there is an I/O error
  • Method Details

    • findSequence

      protected static int findSequence(byte[] sequence, byte[] buffer)
      Finds the start of the given sequence in the buffer. If not found, -1 is returned.
      Parameters:
      sequence - the sequence to locate
      buffer - the buffer to search
      Returns:
      the starting position of the sequence in the buffer if found; otherwise -1