public class FileDescriptorByteChannel
extends java.lang.Object
implements java.nio.channels.ByteChannel
| Constructor and Description |
|---|
FileDescriptorByteChannel(Ruby runtime,
int fd)
Creates a new FileDescriptorByteChannel.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public FileDescriptorByteChannel(Ruby runtime, int fd)
fd - The native unix fd to read/write.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.Channelpublic void close()
throws java.io.IOException
This closes the underlying native file descriptor.
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channeljava.io.IOExceptionCopyright © 2002-2009 JRuby Team. All Rights Reserved.