public class

SubSeekableByteChannel

extends Object
implements SeekableByteChannel
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.io.SubSeekableByteChannel

Class Overview

An seekable channel presenting a region of another seekable channel. Only read-operations are supported. Attempts to write or modify the master channel will raise an IOException.

Summary

Public Constructors
SubSeekableByteChannel(SeekableByteChannel channel, long base, long maxsize)
Create a sub channel.
Public Methods
void close()
Close this sub-channel and its master channel.
boolean isOpen()
long position()
SeekableByteChannel position(long newPosition)
int read(ByteBuffer dst)
long size()
SeekableByteChannel truncate(long size)
int write(ByteBuffer src)
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.io.Closeable
From interface java.lang.AutoCloseable
From interface java.nio.channels.Channel
From interface java.nio.channels.ReadableByteChannel
From interface java.nio.channels.SeekableByteChannel
From interface java.nio.channels.WritableByteChannel

Public Constructors

public SubSeekableByteChannel (SeekableByteChannel channel, long base, long maxsize)

Create a sub channel.

Parameters
channel the main channel
base beginning of region
maxsize size of region
Throws
IOException

Public Methods

public void close ()

Close this sub-channel and its master channel.

Throws
IOException

public boolean isOpen ()

public long position ()

Throws
IOException

public SeekableByteChannel position (long newPosition)

Throws
IOException

public int read (ByteBuffer dst)

Throws
IOException

public long size ()

Throws
IOException

public SeekableByteChannel truncate (long size)

Throws
IOException

public int write (ByteBuffer src)

Throws
IOException