public class ByteArrayChannel extends Object implements SeekableByteChannel
This class is copy of class jdk.nio.zipfs.ByteArrayChannel. There are two reasons why we cannot substitute this class:
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
isOpen() |
long |
position() |
SeekableByteChannel |
position(long position) |
int |
read(ByteBuffer dst) |
long |
size() |
byte[] |
toByteArray()
Creates a newly allocated byte array.
|
SeekableByteChannel |
truncate(long size) |
int |
write(ByteBuffer src) |
public long position()
throws IOException
position in interface SeekableByteChannelIOExceptionpublic SeekableByteChannel position(long position) throws IOException
position in interface SeekableByteChannelIOExceptionpublic int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelread in interface SeekableByteChannelIOExceptionpublic SeekableByteChannel truncate(long size) throws IOException
truncate in interface SeekableByteChannelIOExceptionpublic int write(ByteBuffer src) throws IOException
write in interface SeekableByteChannelwrite in interface WritableByteChannelIOExceptionpublic long size()
throws IOException
size in interface SeekableByteChannelIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionpublic byte[] toByteArray()