Top Inners Fields Constructors Methods
org.jruby

public Class RubyIO

extends RubyObject
implements IOEncodable, Closeable, Flushable
Class Inheritance
All Implemented Interfaces
java.io.Flushable, java.io.Closeable, java.lang.AutoCloseable, org.jruby.util.io.IOEncodable
Known Direct Subclasses
org.jruby.ext.ffi.io.FileDescriptorIO, org.jruby.ext.socket.RubyBasicSocket, org.jruby.RubyFile
Annotations
@JRubyClass
name:IO
include:Enumerable
Imports
java.io.Closeable, .Flushable, .IOException, .InputStream, .OutputStream, java.nio.ByteBuffer, java.nio.channels.Channel, .Channels, .FileChannel, .ReadableByteChannel, .SeekableByteChannel, .SelectionKey, .WritableByteChannel, java.util.Arrays, .HashSet, .Set, jnr.constants.platform.Errno, .Fcntl, .OpenFlags, .PosixFadvise, jnr.enxio.channels.NativeDeviceChannel, .NativeSelectableChannel, jnr.posix.Linux, .POSIX, org.jcodings.Encoding, org.jcodings.specific.ASCIIEncoding, org.jcodings.transcode.EConvFlags, org.jruby.api.API, org.jruby.ast.util.ArgsUtil, org.jruby.anno.JRubyMethod, .JRubyClass, org.jruby.exceptions.EOFError, .IOError, .RaiseException, .StandardError, org.jruby.ext.fcntl.FcntlLibrary, org.jruby.internal.runtime.ThreadedRunnable, org.jruby.ir.runtime.IRRuntimeHelpers, org.jruby.platform.Platform, org.jruby.runtime.Arity, .Block, .ClassIndex, .Helpers, .JavaSites.IOSites, .Signature, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.callsite.CachingCallSite, org.jruby.runtime.encoding.EncodingService, org.jruby.util.ShellLauncher.POpenProcess, org.jruby.util.*, org.jruby.util.cli.Options, org.jruby.util.io.ChannelFD, .EncodingUtils, .FilenoUtil, .Getline, .IOEncodable, .IOOptions, .InvalidValueException, .ModeFlags, .OpenFile, .POSIXProcess, .PopenExecutor, .PosixShim, .SelectExecutor, .STDIO

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
private static class
RubyIO.POpenTuple

Deprecated
public static class
private static class
public static class
public static class
RubyIO.TimeoutError

Represents a Ruby IO::TimeoutErrorError as a throwable Java exception.

Field Summary

Modifier and TypeField and Description
pack-priv static final Set<String>
public static final String
public static final int
private static final Getline.Callback<RubyIO, IRubyObject>
private static final Getline.Callback<RubyIO, RubyArray<T extends IRubyObject>>
private static final Getline.Callback<RubyIO, RubyIO>
protected OpenFile
public static final ByteList
protected boolean
popenSpecial

If the stream is being used for popen, we don't want to destroy the process when we close the stream.

private static final ByteList
pack-priv static final String[]
Inherited from org.jruby.RubyObject:
IVAR_INSPECTING_OBJECT_ALLOCATOROBJECT_ALLOCATORREIFYING_OBJECT_ALLOCATOR

Constructor Summary

AccessConstructor and Description
public
RubyIO(Ruby runtime, RubyClass type)

public
RubyIO(Ruby runtime, OutputStream outputStream)

public
RubyIO(Ruby runtime, OutputStream outputStream, boolean autoclose)

public
RubyIO(Ruby runtime, InputStream inputStream)

public
RubyIO(Ruby runtime, Channel channel)

public
RubyIO(Ruby runtime, RubyClass klass, Channel channel)

public
RubyIO(Ruby runtime, ShellLauncher.POpenProcess process, IOOptions ioOptions)

public
RubyIO(Ruby runtime, STDIO stdio)
Deprecated

public
RubyIO(Ruby runtime, RubyClass cls, ShellLauncher.POpenProcess process, RubyHash options, IOOptions ioOptions)
Deprecated

Method Summary

Modifier and TypeMethod and Description
public void
addBlockingThread(RubyThread
A thread blocking on this IO
thread
)

Add a thread to the list of blocking threads for this IO.

pack-priv static PosixFadvise
public IRubyObject
advise(ThreadContext context, IRubyObject[] argv)

private static boolean
atCharacterBoundary(Encoding enc, byte[] strBytes, int s, int p, int e)

public IRubyObject
public IRubyObject
public IRubyObject
binmode()
Deprecated since 10.0. Use RubyIO#binmode(ThreadContext) instead.

public IRubyObject
public static IRubyObject

Returns:

the binary contents of the given file, at specified length and offset
binread
(ThreadContext
the current ThreadContext
context
,
IRubyObject
the target of the call (IO or a subclass)
recv
,
IRubyObject[]
arguments; path [, length [, offset]]
args
)

binread is just like read, except it doesn't take options and it forces mode to be "rb:ASCII-8BIT"

public static IRubyObject
public IRubyObject
bytes(ThreadContext context, Block block)
Deprecated since 10.0.

public IRubyObject
chars(ThreadContext context, Block block)
Deprecated since 10.0.

public static RubyArray<T extends IRubyObject>
checkExecEnv(ThreadContext context, RubyHash hash)
Deprecated

public static void
checkExecOptions(IRubyObject options)
Deprecated

private void
protected void
checkLength(ThreadContext context, int len)

public static void
checkPopenOptions(IRubyObject options)
Deprecated

private void
public static void
checkSpawnOptions(IRubyObject options)
Deprecated

pack-priv static void
checkUnsupportedOptions(ThreadContext context, RubyHash opts, String[] unsupported, String error)

pack-priv static void
private static void
cleanupPOpen(RubyIO.POpenTuple tuple)
Deprecated

public static ChannelFD
cloexecOpen(Ruby runtime, RubyIO.Sysopen data)

public IRubyObject

Returns:

The IO. Returns nil if the IO was already closed. MRI: rb_io_close_m
close
(final ThreadContext context)

Closes all open resources for the IO.

public final void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public RubyBoolean
public IRubyObject
codepoints(ThreadContext context, Block block)
Deprecated since 10.0.

public static RubyIO
public static IRubyObject
public static IRubyObject
public static IRubyObject
private static RubyFixnum
public static RubyClass
createIOClass(ThreadContext context, RubyClass Object, RubyModule Enumerable)

private IRubyObject
protected static int
doRead(ThreadContext context, OpenFile fptr, byte[] buffer, int start, int len)

public IRubyObject
doReadNonblock(ThreadContext context, IRubyObject arg0, boolean exception)

public IRubyObject
doReadNonblock(ThreadContext context, IRubyObject arg0, IRubyObject arg1, boolean exception)

public IRubyObject
doReadNonblock(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, boolean exception)

public IRubyObject
doReadNonblock(ThreadContext context, IRubyObject[] args, boolean exception)

private long
doSeek(ThreadContext context, long pos, int whence)

private IRubyObject
doWait(ThreadContext context, OpenFile fptr, long tv, int ops)

private static IRubyObject
doWait(ThreadContext context, RubyIO io, OpenFile fptr, long tv, int ops)

public IRubyObject
doWriteNonblock(ThreadContext context, IRubyObject[] argv, boolean useException)
Deprecated

public IRubyObject
each(final ThreadContext context, final Block block)

public IRubyObject
each(final ThreadContext context, IRubyObject arg0, final Block block)

public IRubyObject
each(final ThreadContext context, IRubyObject arg0, IRubyObject arg1, final Block block)

public IRubyObject
each(final ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, final Block block)

public IRubyObject
each(final ThreadContext context, IRubyObject[] args, final Block block)

public IRubyObject
each_byte(ThreadContext context, Block block)

public IRubyObject
each_byteInternal(ThreadContext context, Block block)

Invoke a block for each byte.

public IRubyObject
each_char(ThreadContext context, Block block)

public IRubyObject
public IRubyObject
public IRubyObject
each_line(final ThreadContext context, final Block block)

public IRubyObject
each_line(final ThreadContext context, IRubyObject arg0, final Block block)

public IRubyObject
each_line(final ThreadContext context, IRubyObject arg0, IRubyObject arg1, final Block block)

public IRubyObject
each_line(final ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, final Block block)

public IRubyObject
each_line(final ThreadContext context, IRubyObject[] args, final Block block)

private IRubyObject
eachCodePointCommon(ThreadContext context, Block block, String methodName)

public static IRubyObject
public static IRubyObject
public RubyBoolean
public IRubyObject
public static void
failIfDirectory(Ruby runtime, RubyString pathStr)

public IRubyObject
public IRubyObject
public RubyFixnum
public RubyIO

Returns:

The IO.
flush
(ThreadContext context)

Flushes the IO output stream.

public void
flush()

Implements java.io.Flushable.flush.

Flushes this stream by writing any buffered output to the underlying stream.

protected RubyIO
flushRaw(ThreadContext context, boolean sync)

public static IRubyObject
for_fd(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)

public static IRubyObject
foreach(final ThreadContext context, IRubyObject recv, IRubyObject[] args, final Block block)

private static IRubyObject
foreachInternal(ThreadContext context, IRubyObject recv, IRubyObject[] args, boolean keywords, Block block)

public RubyFixnum
public boolean
public boolean
public IRubyObject
getbyte(ThreadContext context)

Read a byte.

public int
public IRubyObject
getc()
Deprecated

public IRubyObject
public Channel

Returns:

the underlying channel for this IO
getChannel
()

Get the underlying channel from this IO object.

public int
public IRubyObject
public Encoding
public Encoding
public Encoding
public InputStream
public static ModeFlags
getIOModes(Ruby runtime, String modesString)
Deprecated

public static int
getIOModesIntFromString(Ruby runtime, String modesString)
Deprecated

public IRubyObject
getline(ThreadContext context, IRubyObject separator)

public IRubyObject
getline(ThreadContext context, IRubyObject separator, long limit)

getline using logic of gets.

public IRubyObject
getline(Ruby runtime, ByteList separator)
Deprecated

public IRubyObject
getline(Ruby runtime, ByteList separator, long limit)
Deprecated

public IRubyObject
getline(ThreadContext context, ByteList separator)
Deprecated

public IRubyObject
getline(ThreadContext context, ByteList separator, long limit)
Deprecated

pack-priv IRubyObject
getlineImpl(ThreadContext context, IRubyObject rs, final int limit, final boolean chomp)

getline using logic of gets.

private IRubyObject
getlineImplSlowPart(ThreadContext context, final OpenFile fptr, RubyString str, IRubyObject rs, final int limit, final boolean chomp)

public ClassIndex
getNativeClassIndex()

Overrides org.jruby.RubyObject.getNativeClassIndex.

Implements org.jruby.runtime.marshal.CoreObjectType.getNativeClassIndex.

This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.

public OpenFile
public OpenFile
public OpenFile
public OutputStream
pack-priv IRubyObject
getPartial(ThreadContext context, boolean nonblock, boolean noException)

pack-priv IRubyObject
getPartial(ThreadContext context, IRubyObject arg0, boolean nonblock, boolean noException)

pack-priv IRubyObject
getPartial(ThreadContext context, IRubyObject arg0, IRubyObject arg1, boolean nonblock, boolean noException)

pack-priv IRubyObject
getPartial(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, boolean nonblock, boolean noException)

pack-priv IRubyObject
getPartial(ThreadContext context, IRubyObject[] args, boolean nonblock, boolean noException)

private IRubyObject
getPartialCommon(ThreadContext context, Ruby runtime, IRubyObject length, IRubyObject str, boolean nonblock, boolean noException)

public String
public Encoding
private Encoding
public IRubyObject
gets(ThreadContext context)

Read a line.

public IRubyObject
public IRubyObject
gets(ThreadContext context, IRubyObject rs, IRubyObject limit_arg)

public IRubyObject
gets(ThreadContext context, IRubyObject rs, IRubyObject limit_arg, IRubyObject opt)

public boolean
public RubyIO
public IRubyObject
initialize(ThreadContext context, IRubyObject fileNumber, Block unused)

public IRubyObject
initialize(ThreadContext context, IRubyObject fileNumber, IRubyObject second, Block unused)

public IRubyObject
initialize(ThreadContext context, IRubyObject fileNumber, IRubyObject modeValue, IRubyObject options, Block unused)

public IRubyObject
initialize_copy(ThreadContext
the thread context
context
,
IRubyObject
the original
_io
)

Overrides org.jruby.RubyBasicObject.initialize_copy.

Initializes this object as a copy of the original, that is the parameter to this object.

private IRubyObject
initializeCommon(ThreadContext context, int fileno, IRubyObject vmodeArg, IRubyObject opt)

private IRubyObject
public IRubyObject
inspect(ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Returns a string containing a human-readable representation of obj.

private static IRubyObject
inspectPuts(ThreadContext context, IRubyObject maybeIO, RubyArray<T extends IRubyObject> array)

public IRubyObject
private static int
protected static IRubyObject
public IRubyObject
ioctl(ThreadContext context, IRubyObject[] args)

public static IRubyObject
ioOpen(ThreadContext context, IRubyObject recv, IRubyObject filename, IRubyObject vmode, IRubyObject vperm, IRubyObject opt)

pack-priv static RubyIO
ioOpen(ThreadContext context, IRubyObject recv, RubyString filename, IRubyObject vmode, IRubyObject vperm, IRubyObject opt)

public static IRubyObject
ioOpen(ThreadContext context, IRubyObject filename, IRubyObject vmode, IRubyObject vperm, IRubyObject opt)
Deprecated

private static RubyIO
ioOpenGeneric(ThreadContext context, IRubyObject recv, IRubyObject filename, int oflags, int fmode, IOEncodable convconfig, int perm)

public static IRubyObject
ioStaticWrite(ThreadContext context, IRubyObject recv, IRubyObject[] argv, boolean binary)

private IRubyObject
ioWriteNonblock(ThreadContext context, Ruby runtime, IRubyObject str, boolean no_exception)

public boolean
public boolean

Returns:

true if closed
isClosed
()

Is this IO closed MRI: rb_io_closed

private static boolean
private static boolean
public RubyFixnum

Returns:

the current line number.
lineno
(ThreadContext context)

Returns the current line number.

public RubyFixnum
lineno_set(ThreadContext context, IRubyObject
The new line number.
newLineNumber
)

Sets the current line number.

public IRubyObject
lines(final ThreadContext context, Block block)
Deprecated since 10.0.

public final OpenFile
public static IRubyObject
newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)

public static RubyIO
newIO(Ruby runtime, Channel channel)

public static IOOptions
newIOOptions(Ruby runtime, ModeFlags modeFlags)

public static IOOptions
newIOOptions(Ruby runtime, long mode)

public static IOOptions
newIOOptions(Ruby runtime, int mode)

public static IOOptions
newIOOptions(Ruby runtime, String mode)

public static IOOptions
newIOOptions(Ruby runtime, IOOptions oldFlags, int orOflags)

public static ModeFlags
newModeFlags(Ruby runtime, long mode)

public static ModeFlags
newModeFlags(Ruby runtime, int mode)

public static ModeFlags
newModeFlags(Ruby runtime, String mode)

pack-priv static IRubyObject
nonblockEOF(final Ruby runtime, final boolean noException)

public static void
obliterateProcess(Process
The process to obliterate
process
)

Try for around 1s to destroy the child process.

public IRubyObject
op_append(ThreadContext context, IRubyObject anObject)

rb_io_addstr

public IRubyObject
public static IRubyObject
open(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)

private static RubyIO
protected IOOptions
public IRubyObject
public IRubyObject

Returns:

the pid or nil
pid
(ThreadContext context)

Return the process id (pid) of the process this IO object spawned.

public static IRubyObject
public static IRubyObject
pipe(ThreadContext context, IRubyObject klass, Block block)

public static IRubyObject
pipe(ThreadContext context, IRubyObject klass, IRubyObject arg0, Block block)

public static IRubyObject
pipe(ThreadContext context, IRubyObject klass, IRubyObject arg0, IRubyObject arg1, Block block)

public static IRubyObject
public static IRubyObject
pipe(ThreadContext context, IRubyObject klass, IRubyObject[] argv, Block block)
Deprecated

private static void
public static IRubyObject
popen(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)

public static IRubyObject
popen3(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
Deprecated

public static IRubyObject
popen4(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
Deprecated

public static RubyIO.POpenTuple
popenSpecial(ThreadContext context, IRubyObject[] args)
Deprecated

public RubyFixnum
pos(ThreadContext context)

public RubyFixnum
public IRubyObject
public IRubyObject
pread(ThreadContext context, IRubyObject _length, IRubyObject _from, IRubyObject str)

private static long
private static RubyIO
prepIO(ThreadContext context, Channel fd, int fmode, RubyClass klass, String path)

public static RubyIO
prepStdio(Ruby runtime, InputStream f, Channel c, int fmode, RubyClass klass, String path)

public static RubyIO
prepStdio(Ruby runtime, OutputStream f, Channel c, int fmode, RubyClass klass, String path)

private static void
prepStdioEcflags(OpenFile fptr, int fmode)

public static IRubyObject
public static IRubyObject
public static IRubyObject
public static IRubyObject
public IRubyObject
printf(ThreadContext context, IRubyObject[] args)

public static IRubyObject
public IRubyObject
public static IRubyObject
putc(ThreadContext context, IRubyObject maybeIO, IRubyObject object)

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
puts(ThreadContext context, IRubyObject[] args)

public static IRubyObject
puts(ThreadContext context, IRubyObject maybeIO, IRubyObject... args)

public static IRubyObject
puts0(ThreadContext context, IRubyObject maybeIO)

public static IRubyObject
puts1(ThreadContext context, IRubyObject maybeIO, IRubyObject arg0)

public static IRubyObject
puts2(ThreadContext context, IRubyObject maybeIO, IRubyObject arg0, IRubyObject arg1)

public static IRubyObject
puts3(ThreadContext context, IRubyObject maybeIO, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)

private static IRubyObject
putsArray(ThreadContext context, IRubyObject maybeIO, IRubyObject[] args)

private static void
putsSingle(ThreadContext context, Ruby runtime, IRubyObject maybeIO, IRubyObject arg, RubyString separator)

public IRubyObject
private static int
protected IRubyObject
public IRubyObject
read(IRubyObject[] args)
Deprecated since 10.0.

public IRubyObject
read(ThreadContext context, IRubyObject[] args)

public IRubyObject

Returns:

the output buffer viewing the actual range of bytes read
read
(ThreadContext
the current context
context
)

Read all available bytes.

public IRubyObject

Returns:

the output buffer viewing the actual range of bytes read
read
(ThreadContext
the current context
context
,
IRubyObject
a numeric value of the count of bytes to read
length
)

Read length bytes.

public IRubyObject

Returns:

the output buffer viewing the actual range of bytes read
read
(ThreadContext
the current context
context
,
IRubyObject
a numeric value of the count of bytes to read
length
,
IRubyObject
a RubyString buffer or a nil to indicate a new buffer should be created
maybeStr
)

Read into the given buffer (or create a new one) reading length bytes.

public int

Returns:

the number of bytes actually read or -1 for EOF
read
(ThreadContext
the current context
context
,
byte[]
the target buffer
buffer
,
int
start offset in target buffer
start
,
int
count of bytes to read
len
)

Read into the given buffer starting from start and reading len bytes.

public static IRubyObject
read(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block unusedBlock)

public static IRubyObject
read(ThreadContext context, IRubyObject recv, IRubyObject[] args)

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
read_nonblock(ThreadContext context, IRubyObject[] args)
Deprecated

public IRubyObject
public IRubyObject
readchar(ThreadContext context)

Read a char.

public IRubyObject
readchar()
Deprecated

public IRubyObject
readline(ThreadContext context)

Read a line.

public IRubyObject
readline(ThreadContext context, IRubyObject separator)

public IRubyObject
readline(ThreadContext context, IRubyObject separator, IRubyObject limit)

public IRubyObject
readline(ThreadContext context, IRubyObject separator, IRubyObject limit, IRubyObject opts)

public IRubyObject
readline(ThreadContext context, IRubyObject[] args)
Deprecated

public RubyArray<T extends IRubyObject>
public RubyArray<T extends IRubyObject>
public RubyArray<T extends IRubyObject>
public RubyArray<T extends IRubyObject>
public RubyArray<T extends IRubyObject>
public static IRubyObject
readlines(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block unusedBlock)

public IRubyObject
public IRubyObject
public IRubyObject
readpartial(ThreadContext context, IRubyObject[] args)
Deprecated

private static RubyIO
recheckTTY(Ruby runtime, OpenFile fptr, RubyIO io)

public void
removeBlockingThread(RubyThread
A thread blocking on this IO
thread
)

Remove a thread from the list of blocking threads for this IO.

public IRubyObject
reopen(ThreadContext context, IRubyObject[] args)

protected RubyIO
reopenIO(ThreadContext context, RubyIO nfile)

public RubyFixnum
private static void
rscheck(ThreadContext context, byte[] strBytes, int len, IRubyObject rs)

public RubyFixnum
seek(ThreadContext context, IRubyObject[] args)

public RubyFixnum
public RubyFixnum
seek(ThreadContext context, IRubyObject off, IRubyObject whence)

pack-priv static IRubyObject
public static IRubyObject
public static IRubyObject
select_static(ThreadContext context, Ruby runtime, IRubyObject[] args)
Deprecated

public IRubyObject
set_encoding(ThreadContext context, IRubyObject encodingObj)

public IRubyObject
set_encoding(ThreadContext context, IRubyObject encodingString, IRubyObject internalEncoding)

public IRubyObject
set_encoding(ThreadContext context, IRubyObject encodingString, IRubyObject internalEncoding, IRubyObject options)

public IRubyObject
protected RubyIO
public void
setAutoclose(boolean autoclose)

private void
public void
setBlocking(boolean blocking)

public void
public void
public void
public void
public void
public void
protected void
public void
setSync(boolean sync)

private void
private static JavaSites.IOSites
sites(ThreadContext context)

Hides org.jruby.RubyObject.sites.

Retrieve the call sites for this class.

public IRubyObject
public RubyBoolean

Returns:

the current sync mode.
sync
(ThreadContext context)

Returns the current sync mode.

public IRubyObject
sync_set(IRubyObject sync)
Deprecated since 10.0. Use RubyIO#sync_set(ThreadContext, IRubyObject) instead.

public IRubyObject
sync_set(ThreadContext context, IRubyObject
The new sync mode.
sync
)

Sets the current sync mode.

public static IRubyObject
sysopen(IRubyObject recv, IRubyObject[] args, Block block)
Deprecated

public static IRubyObject
sysopen(ThreadContext context, IRubyObject recv, IRubyObject[] argv, Block block)

protected static ChannelFD
sysopen(Ruby runtime, String fname, int oflags, int perm)

private static ChannelFD
sysopenFunc(Ruby runtime, RubyIO.Sysopen data)

private static ChannelFD
public IRubyObject
sysread(ThreadContext context, IRubyObject _length)

public IRubyObject
sysread(ThreadContext context, IRubyObject _length, IRubyObject _str)

public IRubyObject
sysread(ThreadContext context, IRubyObject[] args)
Deprecated

private RubyString
sysreadCommon(ThreadContext context, Ruby runtime, IRubyObject _length, IRubyObject _str)

public RubyFixnum
public IRubyObject
public RubyIO
public <T> T
toJava(Class<T>
The target type to which the object should be converted.
target
)

Overrides org.jruby.RubyBasicObject.toJava.

Implements org.jruby.runtime.builtin.IRubyObject.toJava.

Convert the object to the specified Java class, if possible.

public String
toString()

Overrides org.jruby.RubyObject.toString.

The default toString method is just a wrapper that calls the Ruby "to_s" method.

private static long
transfer(ThreadContext context, ReadableByteChannel from, FileChannel to, long length, long position)

private static long
transfer(FileChannel from, WritableByteChannel to, long remaining, long position)

private static long
transfer(ThreadContext context, ReadableByteChannel from, WritableByteChannel to, long length, long position)

public static IRubyObject
public RubyBoolean
public IRubyObject
public IRubyObject
protected IOOptions
updateIOOptionsFromOptions(ThreadContext context, RubyHash options, IOOptions ioOptions)

See http://ruby-doc.org/core-1.9.3/IO.html#method-c-new for the format of modes in options

public IRubyObject
wait(ThreadContext context, IRubyObject[] argv)

public static IRubyObject
wait(ThreadContext context, IRubyObject _io, IRubyObject[] argv)

public IRubyObject
public static IRubyObject
public IRubyObject
wait_writable(ThreadContext context, IRubyObject[] argv)

waits until input available or timed out and returns self, or nil when EOF reached.

public static IRubyObject
wait_writable(ThreadContext context, IRubyObject _io, IRubyObject[] argv)

waits until input available or timed out and returns self, or nil when EOF reached.

private static void
public IRubyObject
write(ThreadContext
the current context
context
,
IRubyObject
the string to write
str
)

Ruby method IO#write(str), equivalent to io_write_m.

public IRubyObject
write(ThreadContext
the current context
context
,
IRubyObject[]
the strings to write
args
)

Ruby method IO#write(str, ...), equivalent to io_write_m.

public final IRubyObject

Returns:

the count of bytes written
write
(ThreadContext
the current context
context
,
int
the byte to write, as an int
ch
)

Write a single byte to this IO's write target.

public final void
write(ThreadContext
the current context
context
,
byte
the byte to write, as an int
ch
)

Write a single byte to this IO's write target but do not return the number of bytes written (it will be 1).

public IRubyObject

Returns:

the count of bytes written
write
(ThreadContext
the current context
context
,
IRubyObject
the string to write
str
,
boolean
whether to write without syncing
nosync
)

Write the given range of bytes to this IO's write target.

public int

Returns:

the count of bytes written
write
(ThreadContext
the current context
context
,
byte[]
the bytes to write
bytes
,
int
start offset for writing
start
,
int
length to write
length
,
Encoding
encoding of the bytes (will not be verified)
encoding
)

Write the given range of bytes to this IO.

public int

Returns:

the count of bytes written
write
(ThreadContext
the current context
context
,
byte[]
the bytes to write
bytes
,
int
start offset for writing
start
,
int
length to write
length
,
Encoding
encoding of the bytes (will not be verified)
encoding
,
boolean
whether to write without syncing
nosync
)

Write the given range of bytes to this IO.

public int

Returns:

the count of bytes written
write
(byte[]
the bytes to write
bytes
,
int
start offset for writing
start
,
int
length to write
length
,
Encoding
encoding of the bytes (will not be verified)
encoding
,
boolean
whether to write without syncing
nosync
)

Same as write(ThreadContext, byte[], int, int, Encoding, boolean) but context will be retrieved.

public int

Returns:

the count of bytes written
write
(byte[]
the bytes to write
bytes
,
int
start offset for writing
start
,
int
length to write
length
,
Encoding
encoding of the bytes (will not be verified)
encoding
)

Same as write(ThreadContext, byte[], int, int, Encoding, boolean) but context will be retrieved and nosync defaults to false.

public int

Returns:

the count of bytes written
write
(byte[]
the bytes to write
bytes
,
Encoding
encoding of the bytes (will not be verified)
encoding
)

Same as write(ThreadContext, byte[], int, int, Encoding, boolean) but context will be retrieved nosync defaults to false, and the entire byte array will be written.

public void
write(int
the byte to write, as an int
bite
)

Same as write(ThreadContext, byte) but context will be retrieved.

protected static IRubyObject
write(ThreadContext context, IRubyObject maybeIO, ByteList byteList)

protected static IRubyObject
write(ThreadContext context, IRubyObject maybeIO, ByteList byteList, IRubyObject sep)

public static IRubyObject
write(ThreadContext context, IRubyObject maybeIO, IRubyObject str)

public static IRubyObject
write(ThreadContext context, IRubyObject maybeIO, IRubyObject arg0, IRubyObject arg1)

public static IRubyObject
write(ThreadContext context, IRubyObject recv, IRubyObject[] argv)

public IRubyObject
write2(ThreadContext
the current context
context
,
IRubyObject
the first string to write
arg0
,
IRubyObject
the second string to write
arg1
)

Ruby method IO#write(str, ...), equivalent to io_write_m.

public IRubyObject
write3(ThreadContext
the current context
context
,
IRubyObject
the first string to write
arg0
,
IRubyObject
the second string to write
arg1
,
IRubyObject
the third string to write
arg2
)

Ruby method IO#write(str, ...), equivalent to io_write_m.

public IRubyObject
public IRubyObject
public IRubyObject
write_nonblock(ThreadContext context, IRubyObject[] argv)
Deprecated

private static void
private static IRubyObject
public static IRubyObject
writeStatic(ThreadContext context, IRubyObject recv, IRubyObject[] argv, Block unusedBlock)
Deprecated

public static IRubyObject
public static IRubyObject
public static IRubyObject
public static IRubyObject
public static IRubyObject
Inherited from org.jruby.RubyObject:
attachToObjectSpacecallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitconvertToTypedigdig1dig2eqlInternalequalInternalequalsfinishObjectClasshashCodeinspectop_eqqputsspecificEvaltoRubyString