# Class ReadableSeekableStreamByteChannel

java.lang.Object
htsjdk.samtools.seekablestream.ReadableSeekableStreamByteChannel

All Implemented Interfaces:
  `Closeable, AutoCloseable, ByteChannel, Channel, ReadableByteChannel, SeekableByteChannel, WritableByteChannel`

public class ReadableSeekableStreamByteChannel extends Object implements SeekableByteChannel
A class to wrap a `SeekableStream` in a read-only `SeekableByteChannel`.

## Constructor Summary

Constructors
Constructor
Description
`ReadableSeekableStreamByteChannel(SeekableStream seekableStream)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`boolean`
`isOpen()`
`long`
`position()`
`SeekableByteChannel`
`position(long newPosition)`
`int`
`read(ByteBuffer dst)`
`long`
`size()`
`SeekableByteChannel`
`truncate(long size)`
`int`
`write(ByteBuffer src)`

### Methods inherited from class Object

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

## Constructor Details

### ReadableSeekableStreamByteChannel

public ReadableSeekableStreamByteChannel(SeekableStream seekableStream)

## Method Details

### read

public int read(ByteBuffer dst) throws IOException

Specified by:
  `read` in interface `ReadableByteChannel`
Specified by:
  `read` in interface `SeekableByteChannel`
Throws:
  `IOException`

### write

public int write(ByteBuffer src) throws IOException

Specified by:
  `write` in interface `SeekableByteChannel`
Specified by:
  `write` in interface `WritableByteChannel`
Throws:
  `IOException`

### position

public long position()

Specified by:
  `position` in interface `SeekableByteChannel`

### position

public SeekableByteChannel position(long newPosition) throws IOException

Specified by:
  `position` in interface `SeekableByteChannel`
Throws:
  `IOException`

### size

public long size()

Specified by:
  `size` in interface `SeekableByteChannel`

### truncate

public SeekableByteChannel truncate(long size)

Specified by:
  `truncate` in interface `SeekableByteChannel`

### isOpen

public boolean isOpen()

Specified by:
  `isOpen` in interface `Channel`

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Channel`
Specified by:
  `close` in interface `Closeable`
Throws:
  `IOException`