Package org.h2.store.fs
Class FileChannelInputStream
java.lang.Object
java.io.InputStream
org.h2.store.fs.FileChannelInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Allows to read from a file channel like an input stream.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBuffer
private final FileChannel
private final boolean
private long
-
Constructor Summary
ConstructorsConstructorDescriptionFileChannelInputStream
(FileChannel channel, boolean closeChannel) Create a new file object input stream from the file channel. -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
channel
-
closeChannel
private final boolean closeChannel -
buffer
-
pos
private long pos
-
-
Constructor Details
-
FileChannelInputStream
Create a new file object input stream from the file channel.- Parameters:
channel
- the file channelcloseChannel
- whether closing the stream should close the channel
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-