|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyObject
org.jruby.RubyIO
public class RubyIO
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.Finalizer |
Field Summary | |
---|---|
protected static int |
fileno
|
protected IOHandler |
handler
|
protected boolean |
isOpen
|
protected int |
lineNumber
|
protected IOModes |
modes
|
static int |
STDERR
|
static int |
STDIN
|
static int |
STDOUT
|
Fields inherited from class org.jruby.RubyObject |
---|
instanceVariables, isTrue, metaClass, NEVER, OBJECT_ALLOCATOR |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
---|
NULL_ARRAY |
Constructor Summary | |
---|---|
RubyIO(Ruby runtime,
java.nio.channels.Channel channel)
|
|
RubyIO(Ruby runtime,
java.io.InputStream inputStream)
|
|
RubyIO(Ruby runtime,
int descriptor)
|
|
RubyIO(Ruby runtime,
java.io.OutputStream outputStream)
|
|
RubyIO(Ruby runtime,
java.lang.Process process)
|
|
RubyIO(Ruby runtime,
RubyClass type)
|
Method Summary | |
---|---|
IRubyObject |
addString(IRubyObject anObject)
rb_io_addstr |
IRubyObject |
binmode()
|
protected void |
checkReadable()
|
protected void |
checkWriteable()
|
IRubyObject |
close()
Closes all open resources for the IO. |
RubyBoolean |
closed()
Closes the IO. |
IRubyObject |
closeWrite()
|
static RubyClass |
createIOClass(Ruby runtime)
|
IRubyObject |
each_byte(Block block)
Invoke a block for each byte. |
RubyIO |
each_line(IRubyObject[] args,
Block block)
Invoke a block for each line. |
RubyBoolean |
eof()
|
IRubyObject |
fcntl(IRubyObject cmd,
IRubyObject arg)
|
static IRubyObject |
fdOpen(Ruby runtime,
int descriptor)
Open a file descriptor, unless it is already open, then return it. |
RubyFixnum |
fileno()
|
RubyIO |
flush()
Flushes the IO output stream. |
static IRubyObject |
foreach(IRubyObject recv,
IRubyObject[] args,
Block block)
rb_io_s_foreach |
RubyFixnum |
fsync()
|
boolean |
getBlocking()
|
IRubyObject |
getc()
Read a byte. |
java.nio.channels.Channel |
getChannel()
|
java.io.InputStream |
getInStream()
|
IOHandler |
getIOHandlerByFileno(int aFileno)
|
static int |
getNewFileno()
|
java.io.OutputStream |
getOutStream()
|
IRubyObject |
gets(IRubyObject[] args)
Read a line. |
boolean |
hasPendingBuffered()
|
IRubyObject |
initialize_copy(IRubyObject original)
rb_obj_init_copy |
IRubyObject |
initialize(IRubyObject[] args,
Block unusedBlock)
|
IRubyObject |
internalGets(IRubyObject[] args)
Read a line. |
IRubyObject |
io_wait()
waits until input available or timed out and returns self, or nil when EOF reached. |
boolean |
isOpen()
|
RubyFixnum |
lineno_set(IRubyObject newLineNumber)
Sets the current line number. |
RubyFixnum |
lineno()
Returns the current line number. |
IRubyObject |
pid()
Return the process id (pid) of the process this IO object spawned. |
static IRubyObject |
pipe(IRubyObject recv)
|
static IRubyObject |
popen(IRubyObject recv,
IRubyObject[] args,
Block block)
|
RubyFixnum |
pos_set(IRubyObject newPosition)
|
RubyFixnum |
pos()
|
IRubyObject |
print(IRubyObject[] args)
Print some objects to the stream. |
IRubyObject |
printf(IRubyObject[] args)
|
IRubyObject |
putc(IRubyObject object)
|
IRubyObject |
puts(IRubyObject[] args)
|
IRubyObject |
read(IRubyObject[] args)
|
static IRubyObject |
read(IRubyObject recv,
IRubyObject[] args,
Block block)
|
IRubyObject |
readchar()
Read a byte. |
IRubyObject |
readline(IRubyObject[] args)
Read a line. |
RubyArray |
readlines(IRubyObject[] args)
|
static RubyArray |
readlines(IRubyObject recv,
IRubyObject[] args,
Block block)
|
IRubyObject |
readpartial(IRubyObject[] args)
|
IRubyObject |
ready()
returns non-nil if input available without blocking, false if EOF or not open/readable, otherwise nil. |
void |
registerIOHandler(IOHandler newHandler)
|
IRubyObject |
reopen(IRubyObject[] args)
|
RubyFixnum |
rewind()
|
RubyFixnum |
seek(IRubyObject[] args)
|
static IRubyObject |
select_static(Ruby runtime,
IRubyObject[] args)
|
static IRubyObject |
select(IRubyObject recv,
IRubyObject[] args)
|
IRubyObject |
sync_set(IRubyObject newSync)
Sets the current sync mode. |
RubyBoolean |
sync()
Returns the current sync mode. |
IRubyObject |
sysread(IRubyObject[] args)
|
IRubyObject |
syswrite(IRubyObject obj)
|
RubyIO |
to_io()
|
java.lang.String |
toString()
|
RubyBoolean |
tty()
|
IRubyObject |
ungetc(IRubyObject number)
Pushes char represented by int back onto IOS. |
void |
unregisterIOHandler(int aFileno)
|
IRubyObject |
write(IRubyObject obj)
io_write |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int STDIN
public static final int STDOUT
public static final int STDERR
protected IOHandler handler
protected IOModes modes
protected int lineNumber
protected boolean isOpen
protected static int fileno
Constructor Detail |
---|
public RubyIO(Ruby runtime, RubyClass type)
public RubyIO(Ruby runtime, java.io.OutputStream outputStream)
public RubyIO(Ruby runtime, java.io.InputStream inputStream)
public RubyIO(Ruby runtime, java.nio.channels.Channel channel)
public RubyIO(Ruby runtime, java.lang.Process process)
public RubyIO(Ruby runtime, int descriptor)
Method Detail |
---|
public void registerIOHandler(IOHandler newHandler)
public void unregisterIOHandler(int aFileno)
public IOHandler getIOHandlerByFileno(int aFileno)
public static int getNewFileno()
public static RubyClass createIOClass(Ruby runtime)
public static IRubyObject fdOpen(Ruby runtime, int descriptor)
Open a file descriptor, unless it is already open, then return it.
protected void checkWriteable()
protected void checkReadable()
public boolean isOpen()
public java.io.OutputStream getOutStream()
public java.io.InputStream getInStream()
public java.nio.channels.Channel getChannel()
public IRubyObject reopen(IRubyObject[] args)
public IRubyObject internalGets(IRubyObject[] args)
public IRubyObject initialize(IRubyObject[] args, Block unusedBlock)
initialize
in class RubyObject
public IRubyObject binmode()
public IRubyObject syswrite(IRubyObject obj)
public IRubyObject write(IRubyObject obj)
public IRubyObject addString(IRubyObject anObject)
public RubyFixnum fileno()
public RubyFixnum lineno()
public RubyFixnum lineno_set(IRubyObject newLineNumber)
newLineNumber
- The new line number.public RubyBoolean sync()
public IRubyObject pid()
Return the process id (pid) of the process this IO object spawned. If no process exists (popen was not called), then nil is returned. This is not how it appears to be defined but ruby 1.8 works this way.
public boolean hasPendingBuffered()
public RubyFixnum pos()
public RubyFixnum pos_set(IRubyObject newPosition)
public IRubyObject print(IRubyObject[] args)
public IRubyObject printf(IRubyObject[] args)
public IRubyObject putc(IRubyObject object)
public RubyFixnum seek(IRubyObject[] args)
public RubyFixnum rewind()
public RubyFixnum fsync()
public IRubyObject sync_set(IRubyObject newSync)
newSync
- The new sync mode.public RubyBoolean eof()
public RubyBoolean tty()
public IRubyObject initialize_copy(IRubyObject original)
RubyObject
initialize_copy
in class RubyObject
public RubyBoolean closed()
public IRubyObject close()
Closes all open resources for the IO. It also removes it from our magical all open file descriptor pool.
public IRubyObject closeWrite()
public RubyIO flush()
public IRubyObject gets(IRubyObject[] args)
public boolean getBlocking()
public IRubyObject fcntl(IRubyObject cmd, IRubyObject arg) throws java.io.IOException
java.io.IOException
public IRubyObject puts(IRubyObject[] args)
public IRubyObject readline(IRubyObject[] args)
public IRubyObject getc()
public IRubyObject ungetc(IRubyObject number)
Pushes char represented by int back onto IOS.
number
- to push backpublic IRubyObject readpartial(IRubyObject[] args)
public IRubyObject sysread(IRubyObject[] args)
public IRubyObject read(IRubyObject[] args)
public IRubyObject readchar()
public IRubyObject each_byte(Block block)
Invoke a block for each byte.
public RubyIO each_line(IRubyObject[] args, Block block)
Invoke a block for each line.
public RubyArray readlines(IRubyObject[] args)
public RubyIO to_io()
public java.lang.String toString()
toString
in class RubyObject
public static IRubyObject foreach(IRubyObject recv, IRubyObject[] args, Block block)
public static IRubyObject select(IRubyObject recv, IRubyObject[] args)
public static IRubyObject select_static(Ruby runtime, IRubyObject[] args)
public static IRubyObject read(IRubyObject recv, IRubyObject[] args, Block block)
public static RubyArray readlines(IRubyObject recv, IRubyObject[] args, Block block)
public static IRubyObject popen(IRubyObject recv, IRubyObject[] args, Block block)
public static IRubyObject pipe(IRubyObject recv) throws java.lang.Exception
java.lang.Exception
public IRubyObject ready()
public IRubyObject io_wait()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |