|
||||||||||
| 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, RubyObject.ObjectMethods, RubyObject.VariableTableEntry |
| Field Summary | |
|---|---|
protected static int |
filenoIndex
|
protected OpenFile |
openFile
|
| Fields inherited from class org.jruby.RubyObject |
|---|
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, metaClassName, NEVER, NIL_F, OBJECT_ALLOCATOR, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, VARIABLE_TABLE_DEFAULT_CAPACITY, VARIABLE_TABLE_EMPTY_TABLE, VARIABLE_TABLE_LOAD_FACTOR, VARIABLE_TABLE_MAXIMUM_CAPACITY, variableTable, variableTableSize, variableTableThreshold |
| 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,
java.io.OutputStream outputStream)
|
|
RubyIO(Ruby runtime,
java.lang.Process process,
ModeFlags modes)
|
|
RubyIO(Ruby runtime,
RubyClass type)
|
|
RubyIO(Ruby runtime,
STDIO stdio)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected OpenFile openFile
protected static int filenoIndex
| 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,
ModeFlags modes)
public RubyIO(Ruby runtime,
STDIO stdio)
| Method Detail |
|---|
public void registerDescriptor(ChannelDescriptor descriptor)
public void unregisterDescriptor(int aFileno)
public ChannelDescriptor getDescriptorByFileno(int aFileno)
public static int getNewFileno()
public OpenFile getOpenFile()
protected OpenFile getOpenFileChecked()
public static RubyClass createIOClass(Ruby runtime)
public java.io.OutputStream getOutStream()
public java.io.InputStream getInStream()
public java.nio.channels.Channel getChannel()
public Stream getHandler()
public IRubyObject reopen(IRubyObject[] args)
throws InvalidValueException
InvalidValueException
public static ModeFlags getIOModes(Ruby runtime,
java.lang.String modesString)
throws InvalidValueException
InvalidValueException
public static int getIOModesIntFromString(Ruby runtime,
java.lang.String modesString)
public IRubyObject getline(ByteList separator)
protected boolean swallow(int term)
throws java.io.IOException,
BadDescriptorException
java.io.IOException
BadDescriptorException
public IRubyObject getlineFast(int delim)
throws java.io.IOException,
BadDescriptorException
java.io.IOException
BadDescriptorException
public static IRubyObject newInstance(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
public IRubyObject initialize(IRubyObject[] args,
Block unusedBlock)
protected Stream fdopen(ChannelDescriptor existingDescriptor,
ModeFlags modes)
throws InvalidValueException
InvalidValueException
public static IRubyObject open(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
public IRubyObject binmode()
protected void checkInitialized()
protected void checkClosed()
public IRubyObject syswrite(IRubyObject obj)
public IRubyObject write_nonblock(IRubyObject obj)
public IRubyObject write(IRubyObject obj)
protected boolean waitWritable(ChannelDescriptor descriptor)
throws java.io.IOException
java.io.IOException
protected boolean waitReadable(ChannelDescriptor descriptor)
throws java.io.IOException
java.io.IOExceptionprotected int fwrite(ByteList buffer)
public IRubyObject op_append(ThreadContext context,
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 writeDataBuffered()
public RubyFixnum pos()
public RubyFixnum pos_set(IRubyObject newPosition)
public IRubyObject print(ThreadContext context,
IRubyObject[] args)
public IRubyObject printf(ThreadContext context,
IRubyObject[] args)
public IRubyObject putc(ThreadContext context,
IRubyObject object)
public RubyFixnum seek(IRubyObject[] args)
public RubyFixnum sysseek(IRubyObject[] args)
public RubyFixnum rewind()
public RubyFixnum fsync()
public IRubyObject sync_set(IRubyObject newSync)
newSync - The new sync mode.public RubyBoolean eof_p()
public RubyBoolean tty_p()
public IRubyObject initialize_copy(IRubyObject original)
RubyObject
initialize_copy in class RubyObjectpublic RubyBoolean closed_p()
public IRubyObject close()
Closes all open resources for the IO. It also removes it from our magical all open file descriptor pool.
protected IRubyObject close2()
public IRubyObject close_write()
throws BadDescriptorException
BadDescriptorException
public IRubyObject close_read()
throws BadDescriptorException
BadDescriptorExceptionpublic RubyIO flush()
public IRubyObject gets(ThreadContext context,
IRubyObject[] args)
public boolean getBlocking()
public IRubyObject fcntl(IRubyObject cmd,
IRubyObject arg)
public IRubyObject ioctl(IRubyObject[] args)
public IRubyObject ctl(IRubyObject cmd,
IRubyObject arg)
public IRubyObject puts(ThreadContext context,
IRubyObject[] args)
protected void write(ThreadContext context,
ByteList byteList)
public IRubyObject readline(ThreadContext context,
IRubyObject[] args)
public IRubyObject getc()
public IRubyObject ungetc(IRubyObject number)
Pushes char represented by int back onto IOS.
number - to push back
public IRubyObject readpartial(ThreadContext context,
IRubyObject[] args)
public IRubyObject sysread(ThreadContext context,
IRubyObject[] args)
public IRubyObject read_nonblock(IRubyObject[] args)
public IRubyObject read(IRubyObject[] args)
protected IRubyObject readAll(IRubyObject buffer)
throws BadDescriptorException,
java.io.EOFException,
java.io.IOException
BadDescriptorException
java.io.EOFException
java.io.IOExceptionpublic IRubyObject readchar()
public IRubyObject stat()
public IRubyObject each_byte(ThreadContext context,
Block block)
Invoke a block for each byte.
public RubyIO each_line(ThreadContext context,
IRubyObject[] args,
Block block)
Invoke a block for each line.
public RubyArray readlines(IRubyObject[] args)
public RubyIO to_io()
public java.lang.String toString()
RubyObject
toString in class RubyObject
public static IRubyObject foreach(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
public static IRubyObject select(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
public static IRubyObject select_static(ThreadContext context,
Ruby runtime,
IRubyObject[] args)
public static IRubyObject read(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
public static RubyArray readlines(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
public static IRubyObject popen(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
public static IRubyObject pipe(IRubyObject recv)
throws java.lang.Exception
java.lang.Exception
public static IRubyObject copy_stream(IRubyObject recv,
IRubyObject stream1,
IRubyObject stream2)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||