public static class BOMInputStream.Builder extends AbstractStreamBuilder<T,B>
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. |
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).
|
getBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeMax, setCharset, setCharset, setOpenOptionssetByteArray, setCharSequence, setFile, setFile, setInputStream, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriterequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplier, getUncheckedpublic Builder()
BOMInputStream.public BOMInputStream get() throws java.io.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()java.lang.IllegalStateException - if the origin is null.java.lang.UnsupportedOperationException - if the origin cannot be converted to an InputStream.java.io.IOException - if an I/O error occurs converting to an InputStream using AbstractStreamBuilder.getInputStream().AbstractStreamBuilder.getInputStream(),
IOSupplier.getUnchecked()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.Copyright © 2010 - 2025 Adobe. All Rights Reserved