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.FilterInputStream
Stripped down version of Commons IO 2.0's BOMInputStream.
-
-
Field Summary
Fields Modifier and Type Field Description private static int[][]
BOMS
private int
fbIndex
private int
fbLength
private int[]
firstBytes
private boolean
markedAtStart
private int
markFbIndex
-
Constructor Summary
Constructors Constructor Description BOMInputStream(java.io.InputStream s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
find()
private void
getBOM()
void
mark(int readlimit)
private boolean
matches(int[] bom)
int
read()
int
read(byte[] buf)
int
read(byte[] buf, int off, int len)
private int
readFirstBytes()
void
reset()
long
skip(long n)
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] buf, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] buf) throws java.io.IOException
- Overrides:
read
in 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:
mark
in classjava.io.FilterInputStream
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
find
private boolean find()
-
matches
private boolean matches(int[] bom)
-
-