public class

ArraySeekableByteChannel

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

Class Overview

Read-only, seekable, byte-array backed channel.

Summary

Public Constructors
ArraySeekableByteChannel(byte[] data)
Create a read-only, seekable byte channel backed by a byte array.
ArraySeekableByteChannel(byte[] data, int offset, int length)
Create a read-only, seekable byte channel backed by a byte array.
Public Methods
void close()
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 ArraySeekableByteChannel (byte[] data)

Create a read-only, seekable byte channel backed by a byte array.

Parameters
data input data to be wrapped

public ArraySeekableByteChannel (byte[] data, int offset, int length)

Create a read-only, seekable byte channel backed by a byte array.

Parameters
data input data to be wrapped
offset start offset
length wrapped size

Public Methods

public void close ()

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