Package org.h2.store.fs.mem
Class FileMem
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ByteChannel
,Channel
,GatheringByteChannel
,InterruptibleChannel
,ReadableByteChannel
,ScatteringByteChannel
,SeekableByteChannel
,WritableByteChannel
This class represents an in-memory file.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.nio.channels.FileChannel
FileChannel.MapMode
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
(package private) final FileMemData
The file data.private final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
force
(boolean metaData) void
protected void
implTruncate
(long newLength) The truncate implementation.int
read
(ByteBuffer dst, long position) long
size()
toString()
tryLock
(long position, long size, boolean shared) int
write
(ByteBuffer src, long position) Methods inherited from class org.h2.store.fs.FileBaseDefault
position, position, read, truncate, write
Methods inherited from class org.h2.store.fs.FileBase
lock, map, read, transferFrom, transferTo, write
Methods inherited from class java.nio.channels.FileChannel
lock, map, open, open, read, tryLock, write
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Field Details
-
data
The file data. -
readOnly
private final boolean readOnly -
closed
private volatile boolean closed
-
-
Constructor Details
-
FileMem
FileMem(FileMemData data, boolean readOnly)
-
-
Method Details
-
size
public long size()- Specified by:
size
in interfaceSeekableByteChannel
- Specified by:
size
in classFileChannel
-
implTruncate
Description copied from class:FileBaseDefault
The truncate implementation.- Specified by:
implTruncate
in classFileBaseDefault
- Parameters:
newLength
- the new size- Throws:
IOException
- on failure
-
write
- Overrides:
write
in classFileBase
- Throws:
IOException
-
read
- Overrides:
read
in classFileBase
- Throws:
IOException
-
implCloseChannel
- Overrides:
implCloseChannel
in classFileBase
- Throws:
IOException
-
force
- Overrides:
force
in classFileBase
- Throws:
IOException
-
tryLock
- Overrides:
tryLock
in classFileBase
- Throws:
IOException
-
toString
-