|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.util.IOHandler
org.jruby.util.IOHandlerNio
public class IOHandlerNio
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jruby.util.IOHandler |
---|
IOHandler.BadDescriptorException, IOHandler.InvalidValueException, IOHandler.PipeException |
Field Summary |
---|
Fields inherited from class org.jruby.util.IOHandler |
---|
fileno, isOpen, isSync, modes, PARAGRAPH_DELIMETER, SEEK_CUR, SEEK_END, SEEK_SET |
Constructor Summary | |
---|---|
IOHandlerNio(Ruby runtime,
java.nio.channels.Channel channel)
|
Method Summary | |
---|---|
IOHandler |
cloneIOHandler()
|
void |
close()
|
void |
flush()
|
boolean |
getBlocking()
|
int |
getc()
|
java.nio.channels.Channel |
getChannel()
|
java.nio.channels.FileChannel |
getFileChannel()
|
ByteList |
gets(ByteList separator)
|
ByteList |
getsEntireStream()
|
boolean |
hasPendingBuffered()
|
boolean |
isEOF()
Return true when at end of file (EOF). |
int |
pid()
Get the process ID associated with this handler. |
long |
pos()
Get the current position within the file associated with this handler. |
void |
putc(int c)
|
ByteList |
read(int length)
|
ByteList |
readpartial(int length)
|
int |
ready()
Implement IO#ready? as per io/wait in MRI. |
ByteList |
recv(int length)
|
void |
resetByModes(IOModes newModes)
|
void |
rewind()
|
void |
seek(long offset,
int type)
Perform a seek based on pos(). |
void |
setBlocking(boolean block)
|
void |
sync()
Flush and sync all writes to the filesystem. |
ByteList |
sysread(int length)
|
int |
syswrite(ByteList string)
|
int |
syswrite(int c)
|
void |
truncate(long length)
|
void |
ungetc(int c)
|
int |
write(ByteList string)
|
Methods inherited from class org.jruby.util.IOHandler |
---|
checkOpen, checkPermissionsSubsetOf, checkReadable, checkWritable, checkWriteable, getFileno, getModes, getRuntime, isOpen, isReadable, isSync, isWriteable, reset, setFileno, setIsSync, waitUntilReady |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IOHandlerNio(Ruby runtime, java.nio.channels.Channel channel) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public java.nio.channels.Channel getChannel()
public IOHandler cloneIOHandler() throws java.io.IOException
cloneIOHandler
in class IOHandler
java.io.IOException
public void setBlocking(boolean block) throws java.io.IOException
java.io.IOException
public boolean getBlocking()
public ByteList sysread(int length) throws java.io.EOFException, IOHandler.BadDescriptorException, java.io.IOException
sysread
in class IOHandler
java.io.EOFException
IOHandler.BadDescriptorException
java.io.IOException
public int syswrite(ByteList string) throws IOHandler.BadDescriptorException, java.io.IOException
syswrite
in class IOHandler
IOHandler.BadDescriptorException
java.io.IOException
public int syswrite(int c) throws IOHandler.BadDescriptorException, java.io.IOException
syswrite
in class IOHandler
IOHandler.BadDescriptorException
java.io.IOException
public ByteList recv(int length) throws java.io.EOFException, IOHandler.BadDescriptorException, java.io.IOException
java.io.EOFException
IOHandler.BadDescriptorException
java.io.IOException
public ByteList readpartial(int length) throws java.io.IOException, IOHandler.BadDescriptorException, java.io.EOFException
java.io.IOException
IOHandler.BadDescriptorException
java.io.EOFException
public ByteList read(int length) throws java.io.IOException, IOHandler.BadDescriptorException, java.io.EOFException
read
in class IOHandler
java.io.IOException
IOHandler.BadDescriptorException
java.io.EOFException
public int write(ByteList string) throws java.io.IOException, IOHandler.BadDescriptorException
write
in class IOHandler
java.io.IOException
IOHandler.BadDescriptorException
public ByteList gets(ByteList separator) throws java.io.IOException, IOHandler.BadDescriptorException, java.io.EOFException
gets
in class IOHandler
java.io.IOException
IOHandler.BadDescriptorException
java.io.EOFException
public ByteList getsEntireStream() throws java.io.IOException, IOHandler.BadDescriptorException, java.io.EOFException
getsEntireStream
in class IOHandler
java.io.IOException
IOHandler.BadDescriptorException
java.io.EOFException
public int getc() throws java.io.IOException, IOHandler.BadDescriptorException, java.io.EOFException
getc
in class IOHandler
java.io.IOException
IOHandler.BadDescriptorException
java.io.EOFException
public void ungetc(int c)
ungetc
in class IOHandler
public void putc(int c) throws java.io.IOException, IOHandler.BadDescriptorException
putc
in class IOHandler
java.io.IOException
IOHandler.BadDescriptorException
public void flush() throws java.io.IOException, IOHandler.BadDescriptorException
flush
in class IOHandler
java.io.IOException
IOHandler.BadDescriptorException
public void sync() throws java.io.IOException, IOHandler.BadDescriptorException
IOHandler
Flush and sync all writes to the filesystem.
sync
in class IOHandler
java.io.IOException
- if the sync does not work
IOHandler.BadDescriptorException
public boolean isEOF() throws java.io.IOException, IOHandler.BadDescriptorException
IOHandler
Return true when at end of file (EOF).
isEOF
in class IOHandler
java.io.IOException
IOHandler.BadDescriptorException
public void close() throws java.io.IOException
close
in class IOHandler
java.io.IOException
public long pos() throws IOHandler.PipeException, java.io.IOException
IOHandler
Get the current position within the file associated with this handler.
pos
in class IOHandler
IOHandler.PipeException
- ESPIPE (illegal seek) when not a file
java.io.IOException
public void seek(long offset, int type) throws java.io.IOException, IOHandler.InvalidValueException, IOHandler.PipeException
IOHandler
Perform a seek based on pos().
seek
in class IOHandler
java.io.IOException
IOHandler.InvalidValueException
IOHandler.PipeException
public void resetByModes(IOModes newModes) throws java.io.IOException, IOHandler.InvalidValueException
resetByModes
in class IOHandler
java.io.IOException
IOHandler.InvalidValueException
public void rewind() throws java.io.IOException, IOHandler.PipeException
rewind
in class IOHandler
java.io.IOException
IOHandler.PipeException
public void truncate(long length) throws java.io.IOException, IOHandler.PipeException
truncate
in class IOHandler
java.io.IOException
IOHandler.PipeException
public int pid()
IOHandler
Get the process ID associated with this handler.
pid
in class IOHandler
public java.nio.channels.FileChannel getFileChannel()
getFileChannel
in class IOHandler
public boolean hasPendingBuffered()
hasPendingBuffered
in class IOHandler
public int ready() throws java.io.IOException
IOHandler
ready
in class IOHandler
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |