Package org.apache.commons.io.build
Class AbstractOrigin.AbstractRandomAccessFileOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>  
java.lang.Object
org.apache.commons.io.build.AbstractSupplier<T,B>
 
org.apache.commons.io.build.AbstractOrigin<T,B>
 
org.apache.commons.io.build.AbstractOrigin.AbstractRandomAccessFileOrigin<T,B> 
- Type Parameters:
- T- the type of instances to build.
- B- the type of builder subclass.
- All Implemented Interfaces:
- IOSupplier<T>
- Direct Known Subclasses:
- AbstractOrigin.IORandomAccessFileOrigin,- AbstractOrigin.RandomAccessFileOrigin
- Enclosing class:
- AbstractOrigin<T,- B extends AbstractOrigin<T, - B>> 
public abstract static class AbstractOrigin.AbstractRandomAccessFileOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>  
extends AbstractOrigin<T,B> 
A 
RandomAccessFile origin.
 
 This origin cannot support File and Path since you cannot query a RandomAccessFile for those attributes; Use AbstractOrigin.IORandomAccessFileOrigin
 instead.
 
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.commons.io.build.AbstractOriginAbstractOrigin.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.WriterOrigin 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbyte[]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.getCharSequence(Charset charset) Gets this origin as a byte array, if possible.getInputStream(OpenOption... options) Gets this origin as an InputStream, if possible.getOutputStream(OpenOption... options) Gets this origin as an OutputStream, if possible.getRandomAccessFile(OpenOption... openOption) Gets this origin as a RandomAccessFile, if possible.Gets a new Reader on the origin, buffered by default.getWriter(Charset charset, OpenOption... options) Gets a new Writer on the origin, buffered by default.longsize()Gets the size of the origin, if possible.Methods inherited from class org.apache.commons.io.build.AbstractOriginget, getFile, getPath, toStringMethods inherited from class org.apache.commons.io.build.AbstractSupplierasThisMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.io.function.IOSupplierasSupplier, getUnchecked
- 
Constructor Details- 
AbstractRandomAccessFileOriginARandomAccessFileorigin.Starting from this origin, you can everything except a Path and a File. - Parameters:
- origin- The origin, not null.
 
 
- 
- 
Method Details- 
getByteArrayDescription copied from class:AbstractOriginGets this origin as a byte array, if possible.- Overrides:
- getByteArrayin class- AbstractOrigin<T extends RandomAccessFile,- B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T, - B>> 
- Returns:
- this origin as a byte array, if possible.
- Throws:
- IOException- if an I/O error occurs.
 
- 
getByteArrayDescription copied from class:AbstractOriginGets a portion of this origin as a byte array, if possible.- Overrides:
- getByteArrayin class- AbstractOrigin<T extends RandomAccessFile,- B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T, - B>> 
- Parameters:
- position- the initial index of the range to be copied, inclusive.
- length- How many bytes to copy.
- Returns:
- this origin as a byte array, if possible.
- Throws:
- IOException- if an I/O error occurs.
 
- 
getCharSequenceDescription copied from class:AbstractOriginGets this origin as a byte array, if possible.- Overrides:
- getCharSequencein class- AbstractOrigin<T extends RandomAccessFile,- B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T, - B>> 
- Parameters:
- charset- The charset to use if conversion from bytes is needed.
- Returns:
- this origin as a byte array, if possible.
- Throws:
- IOException- if an I/O error occurs.
 
- 
getInputStreamDescription copied from class:AbstractOriginGets this origin as an InputStream, if possible.- Overrides:
- getInputStreamin class- AbstractOrigin<T extends RandomAccessFile,- B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T, - B>> 
- Parameters:
- options- options specifying how the file is opened
- Returns:
- this origin as an InputStream, if possible.
- Throws:
- IOException- if an I/O error occurs.
 
- 
getOutputStreamDescription copied from class:AbstractOriginGets this origin as an OutputStream, if possible.- Overrides:
- getOutputStreamin class- AbstractOrigin<T extends RandomAccessFile,- B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T, - B>> 
- Parameters:
- options- options specifying how the file is opened
- Returns:
- this origin as an OutputStream, if possible.
- Throws:
- IOException- if an I/O error occurs.
 
- 
getRandomAccessFileDescription copied from class:AbstractOriginGets this origin as a RandomAccessFile, if possible.- Overrides:
- getRandomAccessFilein class- AbstractOrigin<T extends RandomAccessFile,- B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T, - B>> 
- Parameters:
- openOption- options like- StandardOpenOption.
- Returns:
- this origin as a RandomAccessFile, if possible.
 
- 
getReaderDescription copied from class:AbstractOriginGets a new Reader on the origin, buffered by default.- Overrides:
- getReaderin class- AbstractOrigin<T extends RandomAccessFile,- B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T, - B>> 
- Parameters:
- charset- the charset to use for decoding, null maps to the default Charset.
- Returns:
- a new Reader on the origin.
- Throws:
- IOException- if an I/O error occurs opening the file.
 
- 
getWriterDescription copied from class:AbstractOriginGets a new Writer on the origin, buffered by default.- Overrides:
- getWriterin class- AbstractOrigin<T extends RandomAccessFile,- B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T, - B>> 
- Parameters:
- charset- the charset to use for encoding
- options- options specifying how the file is opened
- Returns:
- a new Writer on the origin.
- Throws:
- IOException- if an I/O error occurs opening or creating the file.
 
- 
sizeDescription copied from class:AbstractOriginGets the size of the origin, if possible.- Overrides:
- sizein class- AbstractOrigin<T extends RandomAccessFile,- B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T, - B>> 
- Returns:
- the size of the origin in bytes or characters.
- Throws:
- IOException- if an I/O error occurs.
 
 
-