Class InputStreamFromRandomAccessFile
- java.lang.Object
-
- java.io.InputStream
-
- com.biomatters.geneious.publicapi.utilities.InputStreamFromRandomAccessFile
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class InputStreamFromRandomAccessFile extends java.io.InputStream
Provides an InputStream view into the current position in a RandomAccessFile. Useful for performing buffered reading from a RandomAccessFile which otherwise isn't possible without using Java 7. So instead of reading directly from a RandomAccessFile once you have set a position, instead construct : new DataInputStream(new BufferedInputStream(new InputStreamFromRandomAccessFile(randomAccessFile),64)) to read from instead. Note that closing the stream created does not forward the close on to the random access file.- Since:
- API 4.40 (Geneious 5.4.0)
- See Also:
OutputStreamToRandomAccessFile
-
-
Constructor Summary
Constructors Constructor Description InputStreamFromRandomAccessFile(java.io.RandomAccessFile file)
Constructs a new input stream from the current location in the given random access file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-