org.h2.store.fs

## Class FileBaseDefault

- java.lang.Object
- - java.nio.channels.spi.AbstractInterruptibleChannel
  - - java.nio.channels.FileChannel
    - - org.h2.store.fs.FileBase
      - - org.h2.store.fs.FileBaseDefault

All Implemented Interfaces:
  java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.ByteChannel, java.nio.channels.Channel, java.nio.channels.GatheringByteChannel, java.nio.channels.InterruptibleChannel, java.nio.channels.ReadableByteChannel, java.nio.channels.ScatteringByteChannel, java.nio.channels.SeekableByteChannel, java.nio.channels.WritableByteChannel

Direct Known Subclasses:
  FileEncrypt

    public abstract class FileBaseDefault
    extends FileBase

Default implementation of the slow operations that need synchronization because they involve the file position.

### Nested Class Summary

### Nested classes/interfaces inherited from class java.nio.channels.FileChannel

`java.nio.channels.FileChannel.MapMode`

### Constructor Summary

Constructors
Constructor and Description
`FileBaseDefault()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract void` `implTruncate(long size)` The truncate implementation.
`long` `position()`
`java.nio.channels.FileChannel` `position(long newPosition)`
`int` `read(java.nio.ByteBuffer dst)`
`java.nio.channels.FileChannel` `truncate(long newLength)`
`int` `write(java.nio.ByteBuffer src)`

### Methods inherited from class org.h2.store.fs.FileBase

`force, implCloseChannel, lock, map, read, read, transferFrom, transferTo, tryLock, write, write`

### Methods inherited from class java.nio.channels.FileChannel

`lock, open, open, read, size, tryLock, write`

### Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel

`begin, close, end, isOpen`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.nio.channels.Channel

`close, isOpen`

### Constructor Detail

#### FileBaseDefault

    public FileBaseDefault()

### Method Detail

#### position

    public final long position()
                        throws java.io.IOException

Specified by:
  `position` in interface `java.nio.channels.SeekableByteChannel`
Specified by:
  `position` in class `java.nio.channels.FileChannel`
Throws:
  `java.io.IOException`

#### position

    public final java.nio.channels.FileChannel position(long newPosition)
                                                 throws java.io.IOException

Specified by:
  `position` in interface `java.nio.channels.SeekableByteChannel`
Overrides:
  `position` in class `java.nio.channels.FileChannel`
Throws:
  `java.io.IOException`

#### read

    public final int read(java.nio.ByteBuffer dst)
                   throws java.io.IOException

Specified by:
  `read` in interface `java.nio.channels.ReadableByteChannel`
Specified by:
  `read` in interface `java.nio.channels.SeekableByteChannel`
Specified by:
  `read` in class `java.nio.channels.FileChannel`
Throws:
  `java.io.IOException`

#### write

    public final int write(java.nio.ByteBuffer src)
                    throws java.io.IOException

Specified by:
  `write` in interface `java.nio.channels.SeekableByteChannel`
Specified by:
  `write` in interface `java.nio.channels.WritableByteChannel`
Specified by:
  `write` in class `java.nio.channels.FileChannel`
Throws:
  `java.io.IOException`

#### truncate

    public final java.nio.channels.FileChannel truncate(long newLength)
                                                 throws java.io.IOException

Specified by:
  `truncate` in interface `java.nio.channels.SeekableByteChannel`
Overrides:
  `truncate` in class `java.nio.channels.FileChannel`
Throws:
  `java.io.IOException`

#### implTruncate

    protected abstract void implTruncate(long size)
                                  throws java.io.IOException

The truncate implementation.

Parameters:
  `size` - the new size
Throws:
  `java.io.IOException` - on failure