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
SimpleChannel
read
in interface SimpleChannel
buffer
- 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
SimpleChannel
write
in interface SimpleChannel
position
- 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
SimpleChannel
size
in interface SimpleChannel
java.io.IOException
- Any failure to get the sizepublic int supports()
SimpleChannel
supports
in interface SimpleChannel
public void truncate(long size) throws java.io.IOException
SimpleChannel
truncate
in interface SimpleChannel
size
- Size of the file after truncation.java.io.IOException
public void close()
SimpleChannel
close
in interface SimpleChannel
Copyright © 2021 Oracle. All right reserved. Restricted and confidential property of Oracle. Solely for use by recipent under agreement forbidding disclosure.