public static class BOMInputStream.Builder extends AbstractStreamBuilder<BOMInputStream,BOMInputStream.Builder>
BOMInputStream
instance.
For example:
BOMInputStream s = BOMInputStream.builder()
.setPath(path)
.setByteOrderMarks(ByteOrderMark.UTF_8)
.setInclude(false)
.get()
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
BOMInputStream |
get()
Constructs a new instance.
|
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, getCharset, getCharsetDefault, setBufferSize, setBufferSize, setBufferSizeDefault, setCharset, setCharset, setCharsetDefault
checkOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setReader, setURI, setWriter
asThis
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asSupplier
public Builder()
public BOMInputStream get() throws IOException
UnsupportedOperationException
- if the origin cannot be converted to an InputStream.IOException
- if an I/O error occurs.public BOMInputStream.Builder setByteOrderMarks(ByteOrderMark[] byteOrderMarks)
byteOrderMarks
- the ByteOrderMarks to detect and optionally exclude.public BOMInputStream.Builder setInclude(boolean include)
include
- true to include the UTF-8 BOM or false to exclude it. return this;Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.