T - the type of instances to build.B - the type of builder subclass.public abstract class AbstractStreamBuilder<T,B extends AbstractStreamBuilder<T,B>> extends AbstractOriginSupplier<T,B>
T.| Constructor and Description |
|---|
AbstractStreamBuilder()
Constructs a new instance for subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBufferSize()
Gets the buffer size, defaults to
IOUtils.DEFAULT_BUFFER_SIZE (). |
int |
getBufferSizeDefault()
Gets the buffer size default, defaults to
IOUtils.DEFAULT_BUFFER_SIZE (). |
java.lang.CharSequence |
getCharSequence()
Gets a CharSequence from the origin with a Charset.
|
java.nio.charset.Charset |
getCharset()
Gets the Charset, defaults to
Charset.defaultCharset(). |
java.nio.charset.Charset |
getCharsetDefault()
Gets the Charset default, defaults to
Charset.defaultCharset(). |
java.io.File |
getFile()
Gets a File from the origin.
|
java.io.InputStream |
getInputStream()
Gets an InputStream from the origin with OpenOption[].
|
java.nio.file.OpenOption[] |
getOpenOptions()
Gets the OpenOption array.
|
java.io.OutputStream |
getOutputStream()
Gets an OutputStream from the origin with OpenOption[].
|
java.nio.file.Path |
getPath()
Gets a Path from the origin.
|
java.io.RandomAccessFile |
getRandomAccessFile()
Gets a RandomAccessFile from the origin.
|
java.io.Reader |
getReader()
Gets a Reader from the origin with a Charset.
|
java.io.Writer |
getWriter()
Gets a Writer from the origin with an OpenOption[].
|
B |
setBufferSize(int bufferSize)
Sets the buffer size.
|
B |
setBufferSize(java.lang.Integer bufferSize)
Sets the buffer size.
|
B |
setBufferSizeChecker(java.util.function.IntUnaryOperator bufferSizeChecker)
Sets the buffer size checker function.
|
B |
setBufferSizeMax(int bufferSizeMax)
The maximum buffer size checked by the buffer size checker.
|
B |
setCharset(java.nio.charset.Charset charset)
Sets the Charset.
|
B |
setCharset(java.lang.String charset)
Sets the Charset.
|
B |
setOpenOptions(java.nio.file.OpenOption... openOptions)
Sets the OpenOption[].
|
setByteArray, setCharSequence, setFile, setFile, setInputStream, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriterequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplier, get, getUncheckedpublic AbstractStreamBuilder()
public int getBufferSize()
IOUtils.DEFAULT_BUFFER_SIZE ().IOUtils.DEFAULT_BUFFER_SIZE ().public int getBufferSizeDefault()
IOUtils.DEFAULT_BUFFER_SIZE ().IOUtils.DEFAULT_BUFFER_SIZE ().public java.lang.CharSequence getCharSequence()
throws java.io.IOException
java.lang.IllegalStateException - if the origin is null.java.lang.UnsupportedOperationException - if the origin cannot be converted to a CharSequence.java.io.IOException - if an I/O error occurs.AbstractOrigin.getCharSequence(Charset)public java.nio.charset.Charset getCharset()
Charset.defaultCharset().Charset.defaultCharset().public java.nio.charset.Charset getCharsetDefault()
Charset.defaultCharset().Charset.defaultCharset().public java.io.File getFile()
java.lang.IllegalStateException - if the origin is null.java.lang.UnsupportedOperationException - if the origin cannot be converted to a File.AbstractOrigin.getPath()public java.io.InputStream getInputStream()
throws java.io.IOException
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.AbstractOrigin.getInputStream(OpenOption...),
getOpenOptions()public java.nio.file.OpenOption[] getOpenOptions()
public java.io.OutputStream getOutputStream()
throws java.io.IOException
java.lang.IllegalStateException - if the origin is null.java.lang.UnsupportedOperationException - if the origin cannot be converted to an OutputStream.java.io.IOException - if an I/O error occurs.AbstractOrigin.getOutputStream(OpenOption...),
getOpenOptions()public java.nio.file.Path getPath()
java.lang.IllegalStateException - if the origin is null.java.lang.UnsupportedOperationException - if the origin cannot be converted to a Path.AbstractOrigin.getPath()public java.io.RandomAccessFile getRandomAccessFile()
throws java.io.IOException
java.lang.IllegalStateException - if the origin is null.java.lang.UnsupportedOperationException - if the origin cannot be converted to a RandomAccessFile.java.io.IOException - if an I/O error occurs.public java.io.Reader getReader()
throws java.io.IOException
java.lang.IllegalStateException - if the origin is null.java.lang.UnsupportedOperationException - if the origin cannot be converted to a Reader.java.io.IOException - if an I/O error occurs.AbstractOrigin.getReader(Charset),
getCharset()public java.io.Writer getWriter()
throws java.io.IOException
java.lang.IllegalStateException - if the origin is null.java.lang.UnsupportedOperationException - if the origin cannot be converted to a Writer.java.io.IOException - if an I/O error occurs.AbstractOrigin.getOutputStream(OpenOption...),
getOpenOptions()public B setBufferSize(int bufferSize)
Subclasses may ignore this setting.
bufferSize - the buffer size.this instance.public B setBufferSize(java.lang.Integer bufferSize)
Subclasses may ignore this setting.
bufferSize - the buffer size, null resets to the default.this instance.public B setBufferSizeChecker(java.util.function.IntUnaryOperator bufferSizeChecker)
IllegalArgumentException by default.bufferSizeChecker - the buffer size checker function. null resets to the default behavior.this instance.public B setBufferSizeMax(int bufferSizeMax)
IllegalArgumentException.bufferSizeMax - maximum buffer size checked by the buffer size checker.this instance.public B setCharset(java.nio.charset.Charset charset)
Subclasses may ignore this setting.
charset - the Charset, null resets to the default.this instance.public B setCharset(java.lang.String charset)
Subclasses may ignore this setting.
charset - the Charset name, null resets to the default.this instance.public B setOpenOptions(java.nio.file.OpenOption... openOptions)
Normally used with InputStream, OutputStream, and Writer.
Subclasses may ignore this setting.
openOptions - the OpenOption[] name, null resets to the default.this instance.AbstractOriginSupplier.setInputStream(InputStream),
AbstractOriginSupplier.setOutputStream(OutputStream),
AbstractOriginSupplier.setWriter(Writer)Copyright © 2010 - 2025 Adobe. All Rights Reserved