public class ByteBufferSeekableByteChannel extends Object implements SeekableByteChannel
| Constructor and Description |
|---|
ByteBufferSeekableByteChannel(ByteBuffer backing,
int contentLength) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
ByteBuffer |
getContents() |
boolean |
isOpen() |
long |
position() |
int |
read(ByteBuffer dst) |
static ByteBufferSeekableByteChannel |
readFromByteBuffer(ByteBuffer buf) |
SeekableByteChannel |
setPosition(long newPosition) |
long |
size() |
SeekableByteChannel |
truncate(long size) |
int |
write(ByteBuffer src) |
static ByteBufferSeekableByteChannel |
writeToByteBuffer(ByteBuffer buf) |
public ByteBufferSeekableByteChannel(ByteBuffer backing, int contentLength)
public static ByteBufferSeekableByteChannel writeToByteBuffer(ByteBuffer buf)
public static ByteBufferSeekableByteChannel readFromByteBuffer(ByteBuffer buf)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionpublic int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelIOExceptionpublic int write(ByteBuffer src) throws IOException
write in interface WritableByteChannelIOExceptionpublic long position()
throws IOException
position in interface SeekableByteChannelIOExceptionpublic SeekableByteChannel setPosition(long newPosition) throws IOException
setPosition in interface SeekableByteChannelIOExceptionpublic long size()
throws IOException
size in interface SeekableByteChannelIOExceptionpublic SeekableByteChannel truncate(long size) throws IOException
truncate in interface SeekableByteChannelIOExceptionpublic ByteBuffer getContents()
Copyright © 2019. All rights reserved.