T - the type of instances to build.B - the type of builder subclass.public abstract static class AbstractOrigin.AbstractRandomAccessFileOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>> extends AbstractOrigin<T,B>
RandomAccessFile origin.
This origin cannot support File and Path since you cannot query a RandomAccessFile for those attributes; Use AbstractOrigin.IORandomAccessFileOrigin
instead.
AbstractOrigin.AbstractRandomAccessFileOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>, AbstractOrigin.ByteArrayOrigin, AbstractOrigin.CharSequenceOrigin, AbstractOrigin.FileOrigin, AbstractOrigin.InputStreamOrigin, AbstractOrigin.IORandomAccessFileOrigin, AbstractOrigin.OutputStreamOrigin, AbstractOrigin.PathOrigin, AbstractOrigin.RandomAccessFileOrigin, AbstractOrigin.ReaderOrigin, AbstractOrigin.URIOrigin, AbstractOrigin.WriterOriginorigin| Constructor and Description |
|---|
AbstractRandomAccessFileOrigin(T origin)
A
RandomAccessFile origin. |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getByteArray()
Gets this origin as a byte array, if possible.
|
byte[] |
getByteArray(long position,
int length)
Gets a portion of this origin as a byte array, if possible.
|
CharSequence |
getCharSequence(Charset charset)
Gets this origin as a byte array, if possible.
|
InputStream |
getInputStream(OpenOption... options)
Gets this origin as an InputStream, if possible.
|
OutputStream |
getOutputStream(OpenOption... options)
Gets this origin as an OutputStream, if possible.
|
T |
getRandomAccessFile(OpenOption... openOption)
Gets this origin as a RandomAccessFile, if possible.
|
Reader |
getReader(Charset charset)
Gets a new Reader on the origin, buffered by default.
|
Writer |
getWriter(Charset charset,
OpenOption... options)
Gets a new Writer on the origin, buffered by default.
|
long |
size()
Gets the size of the origin, if possible.
|
get, getFile, getPath, toStringasThisclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasSupplier, getUncheckedpublic AbstractRandomAccessFileOrigin(T origin)
RandomAccessFile origin.
Starting from this origin, you can everything except a Path and a File.
origin - The origin, not null.public byte[] getByteArray()
throws IOException
AbstractOrigingetByteArray in class AbstractOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>IOException - if an I/O error occurs.public byte[] getByteArray(long position,
int length)
throws IOException
AbstractOrigingetByteArray in class AbstractOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>position - the initial index of the range to be copied, inclusive.length - How many bytes to copy.IOException - if an I/O error occurs.public CharSequence getCharSequence(Charset charset) throws IOException
AbstractOrigingetCharSequence in class AbstractOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>charset - The charset to use if conversion from bytes is needed.IOException - if an I/O error occurs.public InputStream getInputStream(OpenOption... options) throws IOException
AbstractOrigingetInputStream in class AbstractOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>options - options specifying how the file is openedIOException - if an I/O error occurs.public OutputStream getOutputStream(OpenOption... options) throws IOException
AbstractOrigingetOutputStream in class AbstractOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>options - options specifying how the file is openedIOException - if an I/O error occurs.public T getRandomAccessFile(OpenOption... openOption)
AbstractOrigingetRandomAccessFile in class AbstractOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>openOption - options like StandardOpenOption.public Reader getReader(Charset charset) throws IOException
AbstractOrigingetReader in class AbstractOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>charset - the charset to use for decoding, null maps to the default Charset.IOException - if an I/O error occurs opening the file.public Writer getWriter(Charset charset, OpenOption... options) throws IOException
AbstractOrigingetWriter in class AbstractOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>charset - the charset to use for encodingoptions - options specifying how the file is openedIOException - if an I/O error occurs opening or creating the file.public long size()
throws IOException
AbstractOriginsize in class AbstractOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>IOException - if an I/O error occurs.