T - the type of instances to build.B - the type of builder subclass.public abstract static class AbstractOrigin.AbstractRandomAccessFileOrigin<T extends java.io.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 java.io.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.WriterOrigin| 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.
|
java.lang.CharSequence |
getCharSequence(java.nio.charset.Charset charset)
Gets this origin as a byte array, if possible.
|
java.io.InputStream |
getInputStream(java.nio.file.OpenOption... options)
Gets this origin as an InputStream, if possible.
|
java.io.OutputStream |
getOutputStream(java.nio.file.OpenOption... options)
Gets this origin as an OutputStream, if possible.
|
T |
getRandomAccessFile(java.nio.file.OpenOption... openOption)
Gets this origin as a RandomAccessFile, if possible.
|
java.io.Reader |
getReader(java.nio.charset.Charset charset)
Gets a new Reader on the origin, buffered by default.
|
java.io.Writer |
getWriter(java.nio.charset.Charset charset,
java.nio.file.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, toStringequals, 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 java.io.IOException
AbstractOrigingetByteArray in class AbstractOrigin<T extends java.io.RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>java.io.IOException - if an I/O error occurs.public byte[] getByteArray(long position,
int length)
throws java.io.IOException
AbstractOrigingetByteArray in class AbstractOrigin<T extends java.io.RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>position - the initial index of the range to be copied, inclusive.length - How many bytes to copy.java.io.IOException - if an I/O error occurs.public java.lang.CharSequence getCharSequence(java.nio.charset.Charset charset)
throws java.io.IOException
AbstractOrigingetCharSequence in class AbstractOrigin<T extends java.io.RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>charset - The charset to use if conversion from bytes is needed.java.io.IOException - if an I/O error occurs.public java.io.InputStream getInputStream(java.nio.file.OpenOption... options)
throws java.io.IOException
AbstractOrigingetInputStream in class AbstractOrigin<T extends java.io.RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>options - options specifying how the file is openedjava.io.IOException - if an I/O error occurs.public java.io.OutputStream getOutputStream(java.nio.file.OpenOption... options)
throws java.io.IOException
AbstractOrigingetOutputStream in class AbstractOrigin<T extends java.io.RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>options - options specifying how the file is openedjava.io.IOException - if an I/O error occurs.public T getRandomAccessFile(java.nio.file.OpenOption... openOption)
AbstractOrigingetRandomAccessFile in class AbstractOrigin<T extends java.io.RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>openOption - options like StandardOpenOption.public java.io.Reader getReader(java.nio.charset.Charset charset)
throws java.io.IOException
AbstractOrigingetReader in class AbstractOrigin<T extends java.io.RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>charset - the charset to use for decoding, null maps to the default Charset.java.io.IOException - if an I/O error occurs opening the file.public java.io.Writer getWriter(java.nio.charset.Charset charset,
java.nio.file.OpenOption... options)
throws java.io.IOException
AbstractOrigingetWriter in class AbstractOrigin<T extends java.io.RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>charset - the charset to use for encodingoptions - options specifying how the file is openedjava.io.IOException - if an I/O error occurs opening or creating the file.public long size()
throws java.io.IOException
AbstractOriginsize in class AbstractOrigin<T extends java.io.RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>java.io.IOException - if an I/O error occurs.Copyright © 2010 - 2025 Adobe. All Rights Reserved