|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jruby.ext.ffi.io.FileDescriptorByteChannel
public class FileDescriptorByteChannel
An implementation of ByteChannel that reads from and writes to a native unix file descriptor.
| Constructor Summary | |
|---|---|
FileDescriptorByteChannel(Ruby runtime,
int fd)
Creates a new FileDescriptorByteChannel. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the Channel. |
boolean |
isOpen()
Tests if the ByteChannel is open. |
int |
read(java.nio.ByteBuffer dst)
Reads data from the native unix file descriptor. |
int |
write(java.nio.ByteBuffer src)
Writes data to the native unix file descriptor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileDescriptorByteChannel(Ruby runtime,
int fd)
fd - The native unix fd to read/write.| Method Detail |
|---|
public int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read in interface java.nio.channels.ReadableByteChanneldst - The destination ByteBuffer to place read bytes in.
java.io.IOException - If an error occurred during reading.
public int write(java.nio.ByteBuffer src)
throws java.io.IOException
write in interface java.nio.channels.WritableByteChannelsrc - The source ByteBuffer to write to the file descriptor.
java.io.IOException - If an error occurred during writing.public boolean isOpen()
isOpen in interface java.nio.channels.Channel
public void close()
throws java.io.IOException
This closes the underlying native file descriptor.
close in interface java.io.Closeableclose in interface java.nio.channels.Channeljava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||