Class RpcUnicodeInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.perforce.p4java.impl.mapbased.rpc.sys.RpcUnicodeInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class RpcUnicodeInputStream extends java.io.InputStreamInputStream wrapper that detects and skips the Unicode BOM (Byte Order Mark) in Unicode encoded text files.EF BB BF = UTF-8 BOM FF FE = UTF-16, little-endian BOM FE FF = UTF-16, big-endian BOM FF FE 00 00 = UTF-32, little-endian BOM 00 00 FE FF = UTF-32, big-endian BOM
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRpcUnicodeInputStream.BOMTypes of Unicode BOMs.
-
Constructor Summary
Constructors Constructor Description RpcUnicodeInputStream(java.io.InputStream inputStream)Constructs a new RpcUnicodeInputStream that wraps the InputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()RpcUnicodeInputStream.BOMgetBOM()Returns the BOM found in the InputStream.voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int off, int len)voidreset()longskip(long n)RpcUnicodeInputStreamskipBOM()Skips the BOM found in the InputStream.
-
-
-
Constructor Detail
-
RpcUnicodeInputStream
public RpcUnicodeInputStream(java.io.InputStream inputStream) throws java.lang.NullPointerException, java.io.IOExceptionConstructs a new RpcUnicodeInputStream that wraps the InputStream.- Parameters:
inputStream- inputStream- Throws:
java.lang.NullPointerException- on errorjava.io.IOException- on error
-
-
Method Detail
-
getBOM
public final RpcUnicodeInputStream.BOM getBOM()
Returns the BOM found in the InputStream.- Returns:
- BOM
-
skipBOM
public final RpcUnicodeInputStream skipBOM() throws java.io.IOException
Skips the BOM found in the InputStream.- Returns:
- this
- Throws:
java.io.IOException- on error
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException, java.lang.NullPointerException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOExceptionjava.lang.NullPointerException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException, java.lang.NullPointerException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOExceptionjava.lang.NullPointerException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classjava.io.InputStream
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.InputStream- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
-