public static class BOMInputStream.Builder extends ProxyInputStream.AbstractBuilder<BOMInputStream,BOMInputStream.Builder>
BOMInputStream.
BOMInputStream s = BOMInputStream.builder()
.setPath(Paths.get("MyFile.xml"))
.setByteOrderMarks(ByteOrderMark.UTF_8)
.setInclude(false)
.get();
BOMInputStream s = BOMInputStream.builder()
.setFile(new File("MyFile.xml"))
.setByteOrderMarks(ByteOrderMark.UTF_8)
.setInclude(false)
.get();
get()| Constructor and Description |
|---|
Builder()
Constructs a new builder of
BOMInputStream. |
| Modifier and Type | Method and Description |
|---|---|
BOMInputStream |
get()
Builds a new
BOMInputStream. |
(package private) static ByteOrderMark |
getDefaultByteOrderMark()
For test access.
|
BOMInputStream.Builder |
setByteOrderMarks(ByteOrderMark... byteOrderMarks)
Sets the ByteOrderMarks to detect and optionally exclude.
|
BOMInputStream.Builder |
setInclude(boolean include)
Sets whether to include the UTF-8 BOM (true) or to exclude it (false).
|
getAfterRead, setAfterReadgetBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, setCharset, setCharset, setCharsetDefault, setOpenOptionscheckOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newCharSequenceOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newRandomAccessFileOrigin, newRandomAccessFileOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setCharSequence, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriterasThisclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplier, getUncheckedpublic Builder()
BOMInputStream.public BOMInputStream get() throws IOException
BOMInputStream.
You must set an aspect that supports AbstractStreamBuilder.getInputStream(), otherwise, this method throws an exception.
This builder uses the following aspects: InputStream, OpenOption[], include, and ByteOrderMark[].
This builder uses the following aspects:
AbstractStreamBuilder.getInputStream()IllegalStateException - if the origin is null.UnsupportedOperationException - if the origin cannot be converted to an InputStream.IOException - if an I/O error occurs converting to an InputStream using AbstractStreamBuilder.getInputStream().AbstractStreamBuilder.getInputStream(),
IOSupplier.getUnchecked()static ByteOrderMark getDefaultByteOrderMark()
public BOMInputStream.Builder setByteOrderMarks(ByteOrderMark... byteOrderMarks)
The default is ByteOrderMark.UTF_8.
byteOrderMarks - the ByteOrderMarks to detect and optionally exclude.this instance.public BOMInputStream.Builder setInclude(boolean include)
The default is false.
include - true to include the UTF-8 BOM or false to exclude it. return this;this instance.