Class PomProjectInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.owasp.dependencycheck.xml.pom.PomProjectInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class PomProjectInputStream extends java.io.FilterInputStreamFilters 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 Summary
Fields Modifier and Type Field Description protected static intBUFFER_SIZEThe size of the buffer used to scan the input stream.
-
Constructor Summary
Constructors Constructor Description PomProjectInputStream(java.io.InputStream in)Constructs a new POM project filtering input stream.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static intfindSequence(byte[] sequence, byte[] buffer)Finds the start of the given sequence in the buffer.-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
-
-
-
-
Field Detail
-
BUFFER_SIZE
protected static final int BUFFER_SIZE
The size of the buffer used to scan the input stream.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PomProjectInputStream
public PomProjectInputStream(java.io.InputStream in) throws java.io.IOExceptionConstructs a new POM project filtering input stream. The input stream is wrapped in a buffered input stream.- Parameters:
in- the input stream- Throws:
java.io.IOException- thrown if there is an I/O error
-
-
Method Detail
-
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 locatebuffer- the buffer to search- Returns:
- the starting position of the sequence in the buffer if found; otherwise -1
-
-