java.io.Closeable
, java.lang.AutoCloseable
class ImportFileInputStream
extends java.io.InputStream
seek(..)
to position the stream at offset in the file.Modifier and Type | Field | Description |
---|---|---|
private long |
currentPosition |
|
private long |
fileLength |
|
private java.io.RandomAccessFile |
raf |
Constructor | Description |
---|---|
ImportFileInputStream(java.io.RandomAccessFile raf) |
Create a
ImportFileInputStream object for
the given file. |
Modifier and Type | Method | Description |
---|---|---|
int |
available() |
Returns the number of bytes that can be read from this stream.
|
void |
close() |
Closes this input stream and releases any associated resources
|
int |
read() |
Reads a byte of data from this input stream.
|
int |
read(byte[] buf,
int offset,
int length) |
Reads up to
length bytes of data from this input stream
into given array. |
(package private) void |
seek(long offset) |
Sets the file offset at which the next read will occur.
|
private java.io.RandomAccessFile raf
private long currentPosition
private long fileLength
ImportFileInputStream(java.io.RandomAccessFile raf) throws java.io.IOException
ImportFileInputStream
object for
the given file.raf
- file the stream reads from.java.io.IOException
- if any I/O error occurs.void seek(long offset) throws java.io.IOException
offset
- byte offset in the file.java.io.IOException
- if an I/O error occurs.public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- if an I/O error occurs.public int read(byte[] buf, int offset, int length) throws java.io.IOException
length
bytes of data from this input stream
into given array. This method blocks until some input is
available.read
in class java.io.InputStream
buf
- the buffer into which the data is read.offset
- the start offset of the data.length
- the maximum number of bytes read.-1
if there is no more data because the end of
the file has been reached.java.io.IOException
- if an I/O error occurs.public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
- if an I/O error occurs.public void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
- if an I/O error occurs.Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.