public class NativeSimpleChannel extends java.lang.Object implements SimpleChannel
| Modifier and Type | Field and Description |
|---|---|
long |
nativeChannel |
DIRECTBYTEBUFFERS, READ, READWRITE, WRITE| Constructor and Description |
|---|
NativeSimpleChannel(long n) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close resources associated with this SimpleChannel
|
int |
read(java.nio.ByteBuffer buffer,
long position)
Read bytes into the buffer from the developer's bytes.
|
long |
size()
The size of the developer's bytes.
|
int |
supports()
Return what operations the SimpleChannel supports
|
void |
truncate(long size)
Truncate the stream to the given length.
|
void |
write(java.nio.ByteBuffer buffer,
long position)
Writes bytes from the buffer to the developer's bytes.
|
public int read(java.nio.ByteBuffer buffer,
long position)
throws java.io.IOException
SimpleChannelread in interface SimpleChannelbuffer - Target buffer for the read bytesposition - Location in the underlying byte stream where the method should being reading bytesjava.io.IOException - Any failure to readpublic void write(java.nio.ByteBuffer buffer,
long position)
throws java.io.IOException
SimpleChannelwrite in interface SimpleChannelposition - Location in the underlying byte stream where the method should being writing bytesjava.io.IOException - Any failure to writepublic long size()
throws java.io.IOException
SimpleChannelsize in interface SimpleChanneljava.io.IOException - Any failure to get the sizepublic int supports()
SimpleChannelsupports in interface SimpleChannelpublic void truncate(long size)
throws java.io.IOException
SimpleChanneltruncate in interface SimpleChannelsize - Size of the file after truncation.java.io.IOExceptionpublic void close()
SimpleChannelclose in interface SimpleChannelCopyright © 2021 Oracle. All right reserved. Restricted and confidential property of Oracle. Solely for use by recipent under agreement forbidding disclosure.