Package org.apache.rat.annotation
Class BOMInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.rat.annotation.BOMInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
class BOMInputStream extends java.io.FilterInputStreamStripped down version of Commons IO 2.0's BOMInputStream.
-
-
Field Summary
Fields Modifier and Type Field Description private static int[][]BOMSprivate intfbIndexprivate intfbLengthprivate int[]firstBytesprivate booleanmarkedAtStartprivate intmarkFbIndex
-
Constructor Summary
Constructors Constructor Description BOMInputStream(java.io.InputStream s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanfind()private voidgetBOM()voidmark(int readlimit)private booleanmatches(int[] bom)intread()intread(byte[] buf)intread(byte[] buf, int off, int len)private intreadFirstBytes()voidreset()longskip(long n)
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buf, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buf) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
readFirstBytes
private int readFirstBytes() throws java.io.IOException- Throws:
java.io.IOException
-
getBOM
private void getBOM() throws java.io.IOException- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classjava.io.FilterInputStream
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
find
private boolean find()
-
matches
private boolean matches(int[] bom)
-
-