Class RpcUnicodeInputStream
java.lang.Object
java.io.InputStream
com.perforce.p4java.impl.mapbased.rpc.sys.RpcUnicodeInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
InputStream 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 ClassesModifier and TypeClassDescriptionstatic final classTypes of Unicode BOMs. -
Constructor Summary
ConstructorsConstructorDescriptionRpcUnicodeInputStream(InputStream inputStream) Constructs a new RpcUnicodeInputStream that wraps the InputStream. -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()getBOM()Returns the BOM found in the InputStream.voidmark(int readlimit) booleanintread()intread(byte[] b) intread(byte[] b, int off, int len) voidreset()longskip(long n) final RpcUnicodeInputStreamskipBOM()Skips the BOM found in the InputStream.Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
RpcUnicodeInputStream
Constructs a new RpcUnicodeInputStream that wraps the InputStream.- Parameters:
inputStream- inputStream- Throws:
NullPointerException- on errorIOException- on error
-
-
Method Details
-
getBOM
Returns the BOM found in the InputStream.- Returns:
- BOM
-
skipBOM
Skips the BOM found in the InputStream.- Returns:
- this
- Throws:
IOException- on error
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOExceptionNullPointerException
-
read
- Overrides:
readin classInputStream- Throws:
IOExceptionNullPointerException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-