|
||||||||||
| 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 java.util.List<RubyThread> |
blockingThreads
|
protected static java.util.concurrent.atomic.AtomicInteger |
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, 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,
RubyClass type)
|
|
RubyIO(Ruby runtime,
ShellLauncher.POpenProcess process,
ModeFlags modes)
|
|
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 java.util.List<RubyThread> blockingThreads
protected static java.util.concurrent.atomic.AtomicInteger 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,
ShellLauncher.POpenProcess 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 static RubyIO newIO(Ruby runtime,
java.nio.channels.Channel channel)
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(ThreadContext context,
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(Ruby runtime,
ByteList separator)
protected boolean swallow(int term)
throws java.io.IOException,
BadDescriptorException
java.io.IOException
BadDescriptorException
public IRubyObject getlineFast(Ruby runtime,
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(ThreadContext context,
IRubyObject obj)
public IRubyObject write_nonblock(ThreadContext context,
IRubyObject obj)
public IRubyObject write(ThreadContext context,
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(ThreadContext context)
public RubyFixnum lineno(ThreadContext context)
public RubyFixnum lineno_set(ThreadContext context,
IRubyObject newLineNumber)
newLineNumber - The new line number.public RubyBoolean sync(ThreadContext context)
public IRubyObject pid(ThreadContext context)
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(ThreadContext context)
public RubyFixnum pos_set(ThreadContext context,
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(ThreadContext context,
IRubyObject[] args)
public RubyFixnum seek(ThreadContext context,
IRubyObject arg0)
public RubyFixnum seek(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1)
public RubyFixnum sysseek(ThreadContext context,
IRubyObject[] args)
public RubyFixnum rewind(ThreadContext context)
public RubyFixnum fsync(ThreadContext context)
public IRubyObject sync_set(IRubyObject newSync)
newSync - The new sync mode.public RubyBoolean eof_p(ThreadContext context)
public RubyBoolean tty_p(ThreadContext context)
public IRubyObject initialize_copy(IRubyObject original)
RubyObject
initialize_copy in class RubyObjectpublic RubyBoolean closed_p(ThreadContext context)
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(Ruby runtime)
public IRubyObject close_write(ThreadContext context)
throws BadDescriptorException
BadDescriptorException
public IRubyObject close_read(ThreadContext context)
throws BadDescriptorException
BadDescriptorExceptionpublic RubyIO flush()
public IRubyObject gets(ThreadContext context,
IRubyObject[] args)
public boolean getBlocking()
public IRubyObject fcntl(ThreadContext context,
IRubyObject cmd,
IRubyObject arg)
public IRubyObject ioctl(ThreadContext context,
IRubyObject[] args)
public IRubyObject ctl(Ruby runtime,
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 read_nonblock(ThreadContext context,
IRubyObject[] args)
public IRubyObject readpartial(ThreadContext context,
IRubyObject[] args)
public IRubyObject sysread(ThreadContext context,
IRubyObject[] args)
public IRubyObject read(IRubyObject[] args)
public IRubyObject read(ThreadContext context)
public IRubyObject read(ThreadContext context,
IRubyObject arg0)
public IRubyObject read(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1)
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(ThreadContext context)
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(ThreadContext context,
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 IRubyObject read(ThreadContext context,
IRubyObject recv,
IRubyObject arg0,
Block block)
public static IRubyObject read(ThreadContext context,
IRubyObject recv,
IRubyObject arg0,
IRubyObject arg1,
Block block)
public static IRubyObject read(ThreadContext context,
IRubyObject recv,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
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(ThreadContext context,
IRubyObject recv)
throws java.lang.Exception
java.lang.Exception
public static IRubyObject copy_stream(ThreadContext context,
IRubyObject recv,
IRubyObject stream1,
IRubyObject stream2)
throws java.io.IOException
java.io.IOExceptionpublic void addBlockingThread(RubyThread thread)
thread - A thread blocking on this IOpublic void removeBlockingThread(RubyThread thread)
thread - A thread blocking on this IOprotected void interruptBlockingThreads()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||