public class RubyIO extends RubyObject implements IOEncodable
| Modifier and Type | Class and Description |
|---|---|
private static class |
RubyIO.ByteListCache
Caching reference to allocated byte-lists, allowing for internal byte[] to be
reused, rather than reallocated.
|
private static class |
RubyIO.POpenTuple |
private static class |
RubyIO.Ruby19POpen |
RubyObject.DataRubyBasicObject.FinalizerIOEncodable.ConvConfig| Modifier and Type | Field and Description |
|---|---|
private static java.util.Set<java.lang.String> |
ALL_SPAWN_OPTIONS |
protected java.util.List<RubyThread> |
blockingThreads |
protected int |
ecflags |
protected IRubyObject |
ecopts |
private static byte[] |
EMPTY_BYTE_ARRAY |
protected org.jcodings.Encoding |
enc
readEncoding/writeEncoding deserve a paragraph explanation.
|
protected org.jcodings.Encoding |
enc2 |
protected boolean |
hasBom |
private static ObjectAllocator |
IO_ALLOCATOR |
private static java.lang.String |
msgEINTR |
private static org.jruby.util.ByteList |
NIL_BYTELIST |
protected OpenFile |
openFile |
protected boolean |
popenSpecial
If the stream is being used for popen, we don't want to destroy the process
when we close the stream.
|
protected Transcoder |
readconv |
private static org.jruby.util.ByteList |
RECURSIVE_BYTELIST |
private static java.util.Set<java.lang.String> |
UNSUPPORTED_SPAWN_OPTIONS |
private static java.lang.String |
vendor |
protected Transcoder |
writeconv |
protected IRubyObject |
writeconvAsciicompat |
protected boolean |
writeconvInitialized |
protected int |
writeconvPreEcflags |
protected IRubyObject |
writeconvPreEcopts |
FIELD_ALLOCATED_CLASSES, FIELD_ALLOCATORS, IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, OBJECT_VAR0_ALLOCATOR, OBJECT_VAR1_ALLOCATOR, OBJECT_VAR2_ALLOCATOR, OBJECT_VAR3_ALLOCATOR, OBJECT_VAR4_ALLOCATOR, OBJECT_VAR5_ALLOCATOR, OBJECT_VAR6_ALLOCATOR, OBJECT_VAR7_ALLOCATOR, OBJECT_VAR8_ALLOCATOR, OBJECT_VAR9_ALLOCATOR, REIFYING_OBJECT_ALLOCATORALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, VAR_TABLE_OFFSET, varTable, varTableStampNULL_ARRAY| Constructor and Description |
|---|
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.io.OutputStream outputStream,
boolean autoclose) |
RubyIO(Ruby runtime,
RubyClass type) |
RubyIO(Ruby runtime,
RubyClass cls,
ShellLauncher.POpenProcess process,
RubyHash options,
IOOptions ioOptions)
Deprecated.
|
RubyIO(Ruby runtime,
ShellLauncher.POpenProcess process,
IOOptions ioOptions) |
RubyIO(Ruby runtime,
STDIO stdio) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBlockingThread(RubyThread thread)
Add a thread to the list of blocking threads for this IO.
|
IRubyObject |
autoclose_set(ThreadContext context,
IRubyObject autoclose) |
IRubyObject |
autoclose(ThreadContext context) |
IRubyObject |
binmode() |
static IRubyObject |
binread(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
binread is just like read, except it doesn't take options and it forces
mode to be "rb:ASCII-8BIT"
|
static IRubyObject |
binwrite(ThreadContext context,
IRubyObject recv,
IRubyObject[] args) |
private org.jruby.util.ByteList |
blockingFRead(Stream stream,
RubyThread thread,
int length) |
IRubyObject |
bytes(ThreadContext context) |
IRubyObject |
chars(ThreadContext context,
Block block) |
IRubyObject |
chars19(ThreadContext context,
Block block) |
static void |
checkExecOptions(IRubyObject options)
Warn when using exec with unsupported options.
|
static IRubyObject |
checkPipeCommand(ThreadContext context,
IRubyObject filenameOrCommand) |
static void |
checkPopenOptions(IRubyObject options)
Warn when using spawn with unsupported options.
|
static void |
checkSpawnOptions(IRubyObject options)
Warn when using spawn with unsupported options.
|
private static void |
checkUnsupportedOptions(IRubyObject options,
java.util.Set<java.lang.String> unsupported,
java.lang.String error)
Warn when using unsupported options.
|
private static void |
checkValidOptions(IRubyObject options,
java.util.Set<java.lang.String> valid)
Error when using unknown option.
|
private static void |
cleanupPOpen(RubyIO.POpenTuple tuple) |
private void |
clearCodeConversion() |
private void |
clearReadConversion() |
IRubyObject |
close_read(ThreadContext context) |
IRubyObject |
close_write(ThreadContext context) |
IRubyObject |
close()
Closes all open resources for the IO.
|
RubyBoolean |
closed_p(ThreadContext context) |
IRubyObject |
codepoints(ThreadContext context,
Block block) |
static RubyIO |
convertToIO(ThreadContext context,
IRubyObject obj) |
static IRubyObject |
copy_stream(ThreadContext context,
IRubyObject recv,
IRubyObject[] args) |
static RubyClass |
createIOClass(Ruby runtime) |
IRubyObject |
ctl(Ruby runtime,
IRubyObject cmd,
IRubyObject arg) |
IRubyObject |
doReadNonblock(ThreadContext context,
IRubyObject[] args,
boolean useException) |
private RubyFixnum |
doSeek(ThreadContext context,
long offset,
int whence) |
private IRubyObject |
doWriteConversion(ThreadContext context,
IRubyObject str) |
IRubyObject |
doWriteNonblock(ThreadContext context,
IRubyObject obj,
boolean useException) |
IRubyObject |
each_byte(ThreadContext context,
Block block) |
IRubyObject |
each_byteInternal(ThreadContext context,
Block block)
Invoke a block for each byte.
|
IRubyObject |
each_char(ThreadContext context,
Block block) |
IRubyObject |
each_char19(ThreadContext context,
Block block) |
IRubyObject |
each_charInternal(ThreadContext context,
Block block) |
IRubyObject |
each_charInternal19(ThreadContext context,
Block block) |
IRubyObject |
each_codepoint(ThreadContext context,
Block block) |
IRubyObject |
each_line(ThreadContext context,
IRubyObject[] args,
Block block) |
RubyIO |
each_lineInternal(ThreadContext context,
IRubyObject[] args,
Block block)
Invoke a block for each line.
|
IRubyObject |
each(ThreadContext context,
IRubyObject[] args,
Block block) |
private IRubyObject |
eachCodePointCommon(ThreadContext context,
Block block,
java.lang.String methodName) |
protected static boolean |
emptyBufferOrEOF(org.jruby.util.ByteList buffer,
OpenFile myOpenFile) |
org.jcodings.Encoding |
encodingFromBOM() |
RubyBoolean |
eof_p(ThreadContext context) |
IRubyObject |
external_encoding(ThreadContext context) |
static void |
failIfDirectory(Ruby runtime,
RubyString pathStr) |
IRubyObject |
fcntl(ThreadContext context,
IRubyObject cmd) |
IRubyObject |
fcntl(ThreadContext context,
IRubyObject cmd,
IRubyObject arg) |
protected Stream |
fdopen(ChannelDescriptor existingDescriptor,
ModeFlags modes) |
RubyFixnum |
fileno(ThreadContext context) |
RubyIO |
flush()
Flushes the IO output stream.
|
static IRubyObject |
foreach(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block) |
static IRubyObject |
foreach19(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block) |
private static IRubyObject |
foreachInternal(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
rb_io_s_foreach
|
private static IRubyObject |
foreachInternal19(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
rb_io_s_foreach
|
private org.jruby.util.ByteList |
fread(RubyThread thread,
int length) |
RubyFixnum |
fsync(ThreadContext context) |
protected int |
fwrite(RubyString buffer) |
boolean |
getBlocking() |
boolean |
getBOM() |
IRubyObject |
getbyte19(ThreadContext context) |
IRubyObject |
getc()
Read a byte.
|
IRubyObject |
getc19(ThreadContext context) |
int |
getcCommon() |
private IRubyObject |
getcDirect(ThreadContext context,
Stream stream,
org.jcodings.Encoding enc) |
java.nio.channels.Channel |
getChannel() |
private IRubyObject |
getcTranscoded(ThreadContext context,
Stream stream) |
ChannelDescriptor |
getDescriptorByFileno(int aFileno)
Deprecated.
|
int |
getEcflags() |
IRubyObject |
getEcopts() |
org.jcodings.Encoding |
getEnc() |
org.jcodings.Encoding |
getEnc2() |
Stream |
getHandler()
Deprecated.
|
org.jcodings.Encoding |
getInputEncoding() |
java.io.InputStream |
getInStream() |
static ModeFlags |
getIOModes(Ruby runtime,
java.lang.String modesString)
Deprecated.
|
static int |
getIOModesIntFromString(Ruby runtime,
java.lang.String modesString)
Deprecated.
|
private long |
getLimitFromArgs(IRubyObject[] args) |
IRubyObject |
getline(Ruby runtime,
org.jruby.util.ByteList separator)
Deprecated.
|
IRubyObject |
getline(Ruby runtime,
org.jruby.util.ByteList separator,
long limit)
Deprecated.
|
IRubyObject |
getline(ThreadContext context,
org.jruby.util.ByteList separator) |
IRubyObject |
getline(ThreadContext context,
org.jruby.util.ByteList separator,
long limit)
getline using logic of gets.
|
private IRubyObject |
getline(ThreadContext context,
org.jruby.util.ByteList separator,
long limit,
RubyIO.ByteListCache cache) |
private IRubyObject |
getline(ThreadContext context,
org.jruby.util.ByteList separator,
RubyIO.ByteListCache cache) |
private IRubyObject |
getlineAll(ThreadContext context,
OpenFile myOpenFile) |
private IRubyObject |
getlineEmptyString(Ruby runtime) |
private IRubyObject |
getlineFast(Ruby runtime,
int delim,
RubyIO.ByteListCache cache) |
private IRubyObject |
getlineInner(ThreadContext context,
org.jruby.util.ByteList separator,
long limit,
RubyIO.ByteListCache cache)
getline using logic of gets.
|
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
|
static int |
getNewFileno()
Deprecated.
|
private static org.jruby.util.ByteList |
getNilByteList(Ruby runtime) |
OpenFile |
getOpenFile() |
protected OpenFile |
getOpenFileChecked() |
java.io.OutputStream |
getOutStream() |
private IRubyObject |
getPartial(ThreadContext context,
IRubyObject[] args,
boolean isNonblocking) |
org.jcodings.Encoding |
getReadEncoding() |
IRubyObject |
gets(ThreadContext context)
Read a line.
|
IRubyObject |
gets(ThreadContext context,
IRubyObject separatorArg) |
IRubyObject |
gets(ThreadContext context,
IRubyObject[] args)
Deprecated.
|
IRubyObject |
gets19(ThreadContext context) |
IRubyObject |
gets19(ThreadContext context,
IRubyObject arg) |
IRubyObject |
gets19(ThreadContext context,
IRubyObject separator,
IRubyObject limit_arg) |
private org.jruby.util.ByteList |
getSeparatorForGets(Ruby runtime,
IRubyObject[] args) |
private org.jruby.util.ByteList |
getSeparatorFromArgs(Ruby runtime,
IRubyObject[] args,
int idx) |
private void |
incrementLineno(Ruby runtime,
OpenFile myOpenFile) |
IRubyObject |
initialize_copy(IRubyObject original)
rb_obj_init_copy
Initializes this object as a copy of the original, that is the
parameter to this object.
|
IRubyObject |
initialize(IRubyObject[] args,
Block unusedBlock) |
IRubyObject |
initialize19(ThreadContext context,
IRubyObject fileNumber,
Block unused) |
IRubyObject |
initialize19(ThreadContext context,
IRubyObject fileNumber,
IRubyObject second,
Block unused) |
IRubyObject |
initialize19(ThreadContext context,
IRubyObject fileNumber,
IRubyObject modeValue,
IRubyObject options,
Block unused) |
private IRubyObject |
initializeCommon19(ThreadContext context,
int fileno,
IRubyObject vmodeArg,
IRubyObject opt) |
IRubyObject |
inspect()
rb_obj_inspect
call-seq:
obj.inspect => string
Returns a string containing a human-readable representation of
obj.
|
private static IRubyObject |
inspectPuts(ThreadContext context,
IRubyObject maybeIO,
RubyArray array) |
IRubyObject |
internal_encoding(ThreadContext context) |
protected void |
interruptBlockingThreads()
Fire an IOError in all threads blocking on this IO object
|
protected IRubyObject |
ioClose(Ruby runtime) |
IRubyObject |
ioctl(ThreadContext context,
IRubyObject[] args) |
private IRubyObject |
ioEncStr(IRubyObject str) |
private IRubyObject |
ioGetc(ThreadContext context,
Stream stream) |
static IRubyObject |
ioOpen(ThreadContext context,
IRubyObject filename,
IRubyObject vmode,
IRubyObject vperm,
IRubyObject opt) |
boolean |
isAutoclose() |
boolean |
isClosed()
Is this IO closed
|
RubyFixnum |
lineno_set(ThreadContext context,
IRubyObject newLineNumber)
Sets the current line number.
|
RubyFixnum |
lineno(ThreadContext context)
Returns the current line number.
|
IRubyObject |
lines(ThreadContext context,
Block block) |
IRubyObject |
lines19(ThreadContext context,
Block block) |
protected void |
MakeOpenFile() |
private void |
makeReadConversion(ThreadContext context) |
private RubyString |
makeString(Ruby runtime,
org.jruby.util.ByteList buffer,
boolean isCached) |
private void |
makeWriteConversion(ThreadContext context) |
private boolean |
needsReadConversion() |
private boolean |
needsWriteConversion(ThreadContext context) |
private static RubyIO |
newFile(ThreadContext context,
IRubyObject recv,
IRubyObject... args) |
private static RubyIO |
newFile19(ThreadContext context,
IRubyObject recv,
IRubyObject... args) |
static IRubyObject |
newInstance(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block) |
static RubyIO |
newIO(Ruby runtime,
java.nio.channels.Channel channel) |
static IOOptions |
newIOOptions(Ruby runtime,
int mode) |
static IOOptions |
newIOOptions(Ruby runtime,
IOOptions oldFlags,
int orOflags) |
static IOOptions |
newIOOptions(Ruby runtime,
long mode) |
static IOOptions |
newIOOptions(Ruby runtime,
ModeFlags modeFlags) |
static IOOptions |
newIOOptions(Ruby runtime,
java.lang.String mode) |
static ModeFlags |
newModeFlags(Ruby runtime,
int mode) |
static ModeFlags |
newModeFlags(Ruby runtime,
long mode) |
static ModeFlags |
newModeFlags(Ruby runtime,
java.lang.String mode) |
static void |
obliterateProcess(java.lang.Process process)
Try for around 1s to destroy the child process.
|
IRubyObject |
op_append(ThreadContext context,
IRubyObject anObject)
rb_io_addstr
|
IRubyObject |
op_binmode(ThreadContext context) |
static IRubyObject |
open(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block) |
private static IRubyObject |
openKeyArgs(ThreadContext context,
IRubyObject recv,
IRubyObject[] argv,
IRubyObject opt) |
protected IOOptions |
parseIOOptions(IRubyObject arg) |
protected IOOptions |
parseIOOptions19(IRubyObject arg) |
IRubyObject |
pid(ThreadContext context)
Return the process id (pid) of the process this IO object
spawned.
|
static IRubyObject |
pipe(ThreadContext context,
IRubyObject recv) |
static IRubyObject |
pipe19(ThreadContext context,
IRubyObject recv) |
static IRubyObject |
pipe19(ThreadContext context,
IRubyObject recv,
IRubyObject modes) |
static IRubyObject |
pipe19(ThreadContext context,
IRubyObject recv,
IRubyObject modes,
IRubyObject options) |
static IRubyObject |
popen(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block) |
static IRubyObject |
popen19(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block) |
static IRubyObject |
popen3_19(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block) |
static IRubyObject |
popen3(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block) |
static IRubyObject |
popen4(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block) |
static RubyIO.POpenTuple |
popenSpecial(ThreadContext context,
IRubyObject[] args) |
RubyFixnum |
pos_set(ThreadContext context,
IRubyObject newPosition) |
RubyFixnum |
pos(ThreadContext context) |
IRubyObject |
print(ThreadContext context,
IRubyObject[] args)
Print some objects to the stream.
|
static IRubyObject |
print(ThreadContext context,
IRubyObject maybeIO,
IRubyObject[] args)
Print some objects to the stream.
|
static IRubyObject |
print19(ThreadContext context,
IRubyObject maybeIO,
IRubyObject[] args)
Print some objects to the stream.
|
IRubyObject |
printf(ThreadContext context,
IRubyObject[] args) |
private static IRubyObject[] |
processReadlinesMethodArguments(IRubyObject[] args) |
IRubyObject |
putc(ThreadContext context,
IRubyObject object) |
static IRubyObject |
putc(ThreadContext context,
IRubyObject maybeIO,
IRubyObject object) |
IRubyObject |
puts(ThreadContext context) |
IRubyObject |
puts(ThreadContext context,
IRubyObject arg0) |
IRubyObject |
puts(ThreadContext context,
IRubyObject[] args) |
static IRubyObject |
puts(ThreadContext context,
IRubyObject maybeIO,
IRubyObject... args) |
IRubyObject |
puts(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1) |
IRubyObject |
puts(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2) |
static IRubyObject |
puts0(ThreadContext context,
IRubyObject maybeIO) |
static IRubyObject |
puts1(ThreadContext context,
IRubyObject maybeIO,
IRubyObject arg0) |
static IRubyObject |
puts2(ThreadContext context,
IRubyObject maybeIO,
IRubyObject arg0,
IRubyObject arg1) |
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) |
IRubyObject |
read_nonblock(ThreadContext context,
IRubyObject[] args) |
IRubyObject |
read(IRubyObject[] args) |
IRubyObject |
read(ThreadContext context) |
IRubyObject |
read(ThreadContext context,
IRubyObject arg0) |
IRubyObject |
read(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1) |
static IRubyObject |
read(ThreadContext context,
IRubyObject recv,
IRubyObject[] args) |
static IRubyObject |
read(ThreadContext context,
IRubyObject recv,
IRubyObject path,
Block unusedBlock)
Deprecated.
|
static IRubyObject |
read(ThreadContext context,
IRubyObject recv,
IRubyObject path,
IRubyObject length)
Deprecated.
|
static IRubyObject |
read(ThreadContext context,
IRubyObject recv,
IRubyObject path,
IRubyObject length,
IRubyObject offset)
Deprecated.
|
static IRubyObject |
read19(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block unusedBlock) |
private static IRubyObject |
read19(ThreadContext context,
IRubyObject recv,
IRubyObject path,
IRubyObject length,
IRubyObject offset,
IRubyObject options)
options is a hash which can contain:
encoding: string or encoding
mode: string
open_args: array of string
|
protected RubyString |
readAll(RubyString str) |
protected IRubyObject |
readAll(ThreadContext context) |
protected org.jruby.util.ByteList |
readAllCommon(Ruby runtime) |
IRubyObject |
readbyte(ThreadContext context) |
IRubyObject |
readchar()
Read a byte.
|
IRubyObject |
readchar19(ThreadContext context) |
private void |
readCheck(Stream stream) |
IRubyObject |
readline(ThreadContext context)
Read a line.
|
IRubyObject |
readline(ThreadContext context,
IRubyObject separator) |
IRubyObject |
readline(ThreadContext context,
IRubyObject[] args)
Deprecated.
|
RubyArray |
readlines(ThreadContext context,
IRubyObject[] args) |
static IRubyObject |
readlines(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block unusedBlock) |
RubyArray |
readlines19(ThreadContext context,
IRubyObject[] args) |
static IRubyObject |
readlines19(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block unusedBlock) |
private RubyArray |
readlinesCommon(ThreadContext context,
IRubyObject[] args) |
private static RubyArray |
readlinesCommon(ThreadContext context,
IRubyObject recv,
IRubyObject[] openFileArguments,
IRubyObject[] methodArguments) |
private static RubyArray |
readlinesCommon19(ThreadContext context,
RubyIO file,
IRubyObject[] newArguments) |
private IRubyObject |
readNotAll(ThreadContext context,
OpenFile myOpenFile,
int length) |
private IRubyObject |
readNotAll(ThreadContext context,
OpenFile myOpenFile,
int length,
RubyString str) |
private org.jruby.util.ByteList |
readNotAllCommon(ThreadContext context,
OpenFile myOpenFile,
int length) |
IRubyObject |
readpartial(ThreadContext context,
IRubyObject[] args) |
static IRubyObject |
readStatic(ThreadContext context,
IRubyObject recv,
IRubyObject path) |
static IRubyObject |
readStatic(ThreadContext context,
IRubyObject recv,
IRubyObject path,
IRubyObject length) |
static IRubyObject |
readStatic(ThreadContext context,
IRubyObject recv,
IRubyObject path,
IRubyObject length,
IRubyObject offset) |
void |
registerDescriptor(ChannelDescriptor descriptor)
Deprecated.
|
void |
registerDescriptor(ChannelDescriptor descriptor,
boolean isRetained)
Deprecated.
|
void |
removeBlockingThread(RubyThread thread)
Remove a thread from the list of blocking threads for this IO.
|
IRubyObject |
reopen(ThreadContext context,
IRubyObject[] args) |
protected void |
reopenIO(Ruby runtime,
RubyIO ios) |
protected void |
reopenPath(Ruby runtime,
IRubyObject[] args) |
static boolean |
restartSystemCall(java.lang.Exception e) |
RubyFixnum |
rewind(ThreadContext context) |
RubyFixnum |
seek(ThreadContext context,
IRubyObject arg0) |
RubyFixnum |
seek(ThreadContext context,
IRubyObject[] args) |
RubyFixnum |
seek(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1) |
static IRubyObject |
select_static(ThreadContext context,
Ruby runtime,
IRubyObject[] args) |
static IRubyObject |
select(ThreadContext context,
IRubyObject recv,
IRubyObject[] args) |
private org.jruby.util.ByteList |
separator(Ruby runtime) |
private org.jruby.util.ByteList |
separator(Ruby runtime,
IRubyObject separatorValue) |
private void |
SET_BINARY_MODE() |
IRubyObject |
set_encoding(ThreadContext context,
IRubyObject encodingObj) |
IRubyObject |
set_encoding(ThreadContext context,
IRubyObject encodingString,
IRubyObject internalEncoding) |
IRubyObject |
set_encoding(ThreadContext context,
IRubyObject encodingString,
IRubyObject internalEncoding,
IRubyObject options) |
protected void |
setAscii8bitBinmode() |
void |
setAutoclose(boolean autoclose) |
void |
setBOM(boolean bom) |
void |
setEcflags(int ecflags) |
void |
setEcopts(IRubyObject ecopts) |
void |
setEnc(org.jcodings.Encoding enc) |
void |
setEnc2(org.jcodings.Encoding enc2) |
void |
setEncoding(ThreadContext context,
IRubyObject v1,
IRubyObject v2,
IRubyObject opt) |
private void |
setupPopen(ModeFlags modes,
ShellLauncher.POpenProcess process) |
IRubyObject |
stat(ThreadContext context) |
protected boolean |
swallow(int term) |
IRubyObject |
sync_set(IRubyObject newSync)
Sets the current sync mode.
|
RubyBoolean |
sync(ThreadContext context)
Returns the current sync mode.
|
private void |
synthesizeSystemCallError(java.io.IOException e)
Java does not give us enough information for specific error conditions
so we are reduced to divining them through string matches...
|
static IRubyObject |
sysopen(IRubyObject recv,
IRubyObject[] args,
Block block) |
static IRubyObject |
sysopen19(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block) |
private static IRubyObject |
sysopenCommon(IRubyObject recv,
IRubyObject[] args,
Block block,
IRubyObject pathString) |
IRubyObject |
sysread(ThreadContext context,
IRubyObject[] args) |
RubyFixnum |
sysseek(ThreadContext context,
IRubyObject[] args) |
IRubyObject |
syswrite(ThreadContext context,
IRubyObject obj) |
RubyIO |
to_io() |
java.lang.String |
toString()
The default toString method is just a wrapper that calls the
Ruby "to_s" method.
|
private static long |
transfer(java.nio.channels.FileChannel from,
java.nio.channels.WritableByteChannel to,
long remaining,
long position) |
private static long |
transfer(java.nio.channels.ReadableByteChannel from,
java.nio.channels.FileChannel to) |
private static long |
transfer(ThreadContext context,
java.nio.channels.ReadableByteChannel from,
java.nio.channels.WritableByteChannel to) |
static IRubyObject |
tryConvert(ThreadContext context,
IRubyObject recv,
IRubyObject arg) |
RubyBoolean |
tty_p(ThreadContext context) |
IRubyObject |
ungetc(IRubyObject number)
Pushes char represented by int back onto IOS.
|
IRubyObject |
ungetc19(IRubyObject character) |
void |
ungetcCommon(int ch) |
void |
unregisterDescriptor(int aFileno)
Deprecated.
|
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
|
private boolean |
waitReadable(Stream stream) |
private boolean |
waitWritable(Stream stream) |
IRubyObject |
write_nonblock(ThreadContext context,
IRubyObject obj) |
protected IRubyObject |
write(ThreadContext context,
org.jruby.util.ByteList byteList) |
IRubyObject |
write(ThreadContext context,
IRubyObject obj)
io_write
|
protected static IRubyObject |
write(ThreadContext context,
IRubyObject maybeIO,
org.jruby.util.ByteList byteList) |
static IRubyObject |
write(ThreadContext context,
IRubyObject maybeIO,
IRubyObject str) |
private static IRubyObject |
write19(ThreadContext context,
IRubyObject recv,
IRubyObject path,
IRubyObject str,
IRubyObject offset,
RubyHash options)
options is a hash which can contain:
encoding: string or encoding
mode: string
open_args: array of string
|
boolean |
writeDataBuffered() |
private static IRubyObject |
writeSeparator(ThreadContext context,
IRubyObject maybeIO) |
static IRubyObject |
writeStatic(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block unusedBlock) |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, hashCode, initialize, initialize, inspect, op_eqq, puts, specificEvaladdFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getNativeHandle, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, infectBy, infectBy, initialize19, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, op_cmp, op_equal_19, op_equal, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, recacheBuiltinMethods, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method_added19, singleton_method_removed19, singleton_method_undefined19, singleton_methods, singleton_methods19, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_s, toJava, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderprivate static ObjectAllocator IO_ALLOCATOR
private static java.lang.String vendor
private static java.lang.String msgEINTR
private static final org.jruby.util.ByteList NIL_BYTELIST
private static final org.jruby.util.ByteList RECURSIVE_BYTELIST
private static final byte[] EMPTY_BYTE_ARRAY
private static final java.util.Set<java.lang.String> UNSUPPORTED_SPAWN_OPTIONS
private static final java.util.Set<java.lang.String> ALL_SPAWN_OPTIONS
protected Transcoder readconv
protected boolean writeconvInitialized
protected Transcoder writeconv
protected OpenFile openFile
protected java.util.List<RubyThread> blockingThreads
protected org.jcodings.Encoding enc
protected org.jcodings.Encoding enc2
protected int ecflags
protected IRubyObject ecopts
protected int writeconvPreEcflags
protected IRubyObject writeconvPreEcopts
protected IRubyObject writeconvAsciicompat
protected boolean popenSpecial
protected boolean hasBom
public RubyIO(Ruby runtime, java.io.OutputStream outputStream)
public RubyIO(Ruby runtime, java.io.OutputStream outputStream, boolean autoclose)
public RubyIO(Ruby runtime, java.io.InputStream inputStream)
public RubyIO(Ruby runtime, java.nio.channels.Channel channel)
public RubyIO(Ruby runtime, ShellLauncher.POpenProcess process, IOOptions ioOptions)
@Deprecated public RubyIO(Ruby runtime, RubyClass cls, ShellLauncher.POpenProcess process, RubyHash options, IOOptions ioOptions)
public OpenFile getOpenFile()
protected OpenFile getOpenFileChecked()
public int getNativeTypeIndex()
RubyObjectgetNativeTypeIndex in interface CoreObjectTypegetNativeTypeIndex in class RubyObjectClassIndexpublic java.io.OutputStream getOutStream()
public java.io.InputStream getInStream()
public java.nio.channels.Channel getChannel()
@Deprecated public Stream getHandler() throws BadDescriptorException
BadDescriptorExceptionprotected void reopenPath(Ruby runtime, IRubyObject[] args)
public IRubyObject reopen(ThreadContext context, IRubyObject[] args)
@Deprecated public static ModeFlags getIOModes(Ruby runtime, java.lang.String modesString)
@Deprecated public static int getIOModesIntFromString(Ruby runtime, java.lang.String modesString)
private org.jruby.util.ByteList separator(Ruby runtime)
private org.jruby.util.ByteList separator(Ruby runtime, IRubyObject separatorValue)
private org.jruby.util.ByteList getSeparatorFromArgs(Ruby runtime, IRubyObject[] args, int idx)
private org.jruby.util.ByteList getSeparatorForGets(Ruby runtime, IRubyObject[] args)
private IRubyObject getline(ThreadContext context, org.jruby.util.ByteList separator, RubyIO.ByteListCache cache)
public IRubyObject getline(ThreadContext context, org.jruby.util.ByteList separator)
public IRubyObject getline(ThreadContext context, org.jruby.util.ByteList separator, long limit)
private IRubyObject getline(ThreadContext context, org.jruby.util.ByteList separator, long limit, RubyIO.ByteListCache cache)
private IRubyObject getlineEmptyString(Ruby runtime)
private IRubyObject getlineAll(ThreadContext context, OpenFile myOpenFile) throws java.io.IOException, BadDescriptorException
java.io.IOExceptionBadDescriptorExceptionprivate IRubyObject getlineInner(ThreadContext context, org.jruby.util.ByteList separator, long limit, RubyIO.ByteListCache cache)
public org.jcodings.Encoding getEnc()
getEnc in interface IOEncodablepublic org.jcodings.Encoding getReadEncoding()
public org.jcodings.Encoding getEnc2()
getEnc2 in interface IOEncodablepublic org.jcodings.Encoding getInputEncoding()
private RubyString makeString(Ruby runtime, org.jruby.util.ByteList buffer, boolean isCached)
protected boolean swallow(int term)
throws java.io.IOException,
BadDescriptorException
java.io.IOExceptionBadDescriptorExceptionpublic static boolean restartSystemCall(java.lang.Exception e)
private IRubyObject getlineFast(Ruby runtime, int delim, RubyIO.ByteListCache cache) throws java.io.IOException, BadDescriptorException
java.io.IOExceptionBadDescriptorExceptionpublic static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
private IRubyObject initializeCommon19(ThreadContext context, int fileno, IRubyObject vmodeArg, IRubyObject opt)
public IRubyObject initialize19(ThreadContext context, IRubyObject fileNumber, Block unused)
public IRubyObject initialize19(ThreadContext context, IRubyObject fileNumber, IRubyObject second, Block unused)
public IRubyObject initialize19(ThreadContext context, IRubyObject fileNumber, IRubyObject modeValue, IRubyObject options, Block unused)
protected IOOptions parseIOOptions(IRubyObject arg)
protected IOOptions parseIOOptions19(IRubyObject arg)
public IRubyObject initialize(IRubyObject[] args, Block unusedBlock)
protected Stream fdopen(ChannelDescriptor existingDescriptor, ModeFlags modes)
public IRubyObject external_encoding(ThreadContext context)
public IRubyObject internal_encoding(ThreadContext context)
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 void setEncoding(ThreadContext context, IRubyObject v1, IRubyObject v2, IRubyObject opt)
public static IRubyObject open(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
public static IRubyObject sysopen(IRubyObject recv, IRubyObject[] args, Block block)
public static IRubyObject sysopen19(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
private static IRubyObject sysopenCommon(IRubyObject recv, IRubyObject[] args, Block block, IRubyObject pathString)
public boolean isAutoclose()
public void setAutoclose(boolean autoclose)
public IRubyObject autoclose(ThreadContext context)
public IRubyObject autoclose_set(ThreadContext context, IRubyObject autoclose)
public IRubyObject binmode()
public IRubyObject op_binmode(ThreadContext context)
public IRubyObject syswrite(ThreadContext context, IRubyObject obj)
public IRubyObject write_nonblock(ThreadContext context, IRubyObject obj)
public IRubyObject doWriteNonblock(ThreadContext context, IRubyObject obj, boolean useException)
public IRubyObject write(ThreadContext context, IRubyObject obj)
private boolean waitWritable(Stream stream)
private boolean waitReadable(Stream stream)
protected int fwrite(RubyString 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 RubyFixnum pos(ThreadContext context)
public RubyFixnum pos_set(ThreadContext context, IRubyObject newPosition)
public IRubyObject print(ThreadContext context, IRubyObject[] args)
public static IRubyObject print(ThreadContext context, IRubyObject maybeIO, IRubyObject[] args)
public static IRubyObject print19(ThreadContext context, IRubyObject maybeIO, IRubyObject[] args)
public IRubyObject printf(ThreadContext context, IRubyObject[] args)
public IRubyObject putc(ThreadContext context, IRubyObject object)
public static IRubyObject putc(ThreadContext context, IRubyObject maybeIO, 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)
private RubyFixnum doSeek(ThreadContext context, long offset, int whence)
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)
RubyBasicObjectinitialize_copy in class RubyBasicObjectpublic RubyBoolean closed_p(ThreadContext context)
public boolean isClosed()
public IRubyObject close()
Closes all open resources for the IO. It also removes it from our magical all open file descriptor pool.
protected IRubyObject ioClose(Ruby runtime)
public IRubyObject close_write(ThreadContext context)
public IRubyObject close_read(ThreadContext context)
public RubyIO flush()
public IRubyObject gets(ThreadContext context)
public IRubyObject gets(ThreadContext context, IRubyObject separatorArg)
public IRubyObject gets19(ThreadContext context)
public IRubyObject gets19(ThreadContext context, IRubyObject arg)
public IRubyObject gets19(ThreadContext context, IRubyObject separator, IRubyObject limit_arg)
public boolean getBlocking()
public IRubyObject fcntl(ThreadContext context, IRubyObject cmd)
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)
public IRubyObject puts(ThreadContext context, IRubyObject arg0)
public IRubyObject puts(ThreadContext context, IRubyObject arg0, IRubyObject arg1)
public IRubyObject puts(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
public IRubyObject puts(ThreadContext context, 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)
public static IRubyObject puts(ThreadContext context, IRubyObject maybeIO, IRubyObject... args)
private static IRubyObject writeSeparator(ThreadContext context, IRubyObject maybeIO)
private static IRubyObject putsArray(ThreadContext context, IRubyObject maybeIO, IRubyObject[] args)
private static void putsSingle(ThreadContext context, Ruby runtime, IRubyObject maybeIO, IRubyObject arg, RubyString separator)
protected IRubyObject write(ThreadContext context, org.jruby.util.ByteList byteList)
protected static IRubyObject write(ThreadContext context, IRubyObject maybeIO, org.jruby.util.ByteList byteList)
public static IRubyObject write(ThreadContext context, IRubyObject maybeIO, IRubyObject str)
private static IRubyObject inspectPuts(ThreadContext context, IRubyObject maybeIO, RubyArray array)
public IRubyObject inspect()
RubyBasicObjectto_s method to
generate the string.
[ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]"
Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"inspect in interface IRubyObjectinspect in class RubyBasicObjectpublic IRubyObject readline(ThreadContext context)
public IRubyObject readline(ThreadContext context, IRubyObject separator)
public IRubyObject getc()
public IRubyObject readchar19(ThreadContext context)
public IRubyObject getbyte19(ThreadContext context)
public IRubyObject readbyte(ThreadContext context)
private IRubyObject getcTranscoded(ThreadContext context, Stream stream) throws java.io.IOException, BadDescriptorException, InvalidValueException
java.io.IOExceptionBadDescriptorExceptionInvalidValueExceptionprivate IRubyObject ioEncStr(IRubyObject str)
private IRubyObject getcDirect(ThreadContext context, Stream stream, org.jcodings.Encoding enc) throws InvalidValueException, BadDescriptorException, java.io.IOException
InvalidValueExceptionBadDescriptorExceptionjava.io.IOExceptionpublic IRubyObject getc19(ThreadContext context)
private IRubyObject ioGetc(ThreadContext context, Stream stream) throws java.io.IOException, BadDescriptorException, InvalidValueException
java.io.IOExceptionBadDescriptorExceptionInvalidValueExceptionprivate void SET_BINARY_MODE()
public int getcCommon()
private void readCheck(Stream stream)
public IRubyObject ungetc(IRubyObject number)
Pushes char represented by int back onto IOS.
number - to push backpublic IRubyObject ungetc19(IRubyObject character)
public void ungetcCommon(int ch)
public IRubyObject read_nonblock(ThreadContext context, IRubyObject[] args)
public IRubyObject doReadNonblock(ThreadContext context, IRubyObject[] args, boolean useException)
public IRubyObject readpartial(ThreadContext context, IRubyObject[] args)
private IRubyObject getPartial(ThreadContext context, IRubyObject[] args, boolean isNonblocking)
public IRubyObject sysread(ThreadContext context, IRubyObject[] args)
private void synthesizeSystemCallError(java.io.IOException e)
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)
private IRubyObject readNotAll(ThreadContext context, OpenFile myOpenFile, int length, RubyString str)
private IRubyObject readNotAll(ThreadContext context, OpenFile myOpenFile, int length)
private org.jruby.util.ByteList readNotAllCommon(ThreadContext context, OpenFile myOpenFile, int length)
protected static boolean emptyBufferOrEOF(org.jruby.util.ByteList buffer,
OpenFile myOpenFile)
throws BadDescriptorException,
java.io.IOException
BadDescriptorExceptionjava.io.IOExceptionprotected RubyString readAll(RubyString str) throws BadDescriptorException, java.io.EOFException, java.io.IOException
BadDescriptorExceptionjava.io.EOFExceptionjava.io.IOExceptionprotected IRubyObject readAll(ThreadContext context) throws BadDescriptorException, java.io.EOFException, java.io.IOException
BadDescriptorExceptionjava.io.EOFExceptionjava.io.IOExceptionprotected org.jruby.util.ByteList readAllCommon(Ruby runtime) throws BadDescriptorException, java.io.EOFException, java.io.IOException
BadDescriptorExceptionjava.io.EOFExceptionjava.io.IOExceptionprivate org.jruby.util.ByteList fread(RubyThread thread, int length) throws java.io.IOException, BadDescriptorException
java.io.IOExceptionBadDescriptorExceptionprivate org.jruby.util.ByteList blockingFRead(Stream stream, RubyThread thread, int length) throws java.io.IOException, BadDescriptorException
java.io.IOExceptionBadDescriptorExceptionpublic IRubyObject readchar()
public IRubyObject stat(ThreadContext context)
public IRubyObject each_byteInternal(ThreadContext context, Block block)
Invoke a block for each byte.
public IRubyObject each_byte(ThreadContext context, Block block)
public IRubyObject bytes(ThreadContext context)
public IRubyObject lines(ThreadContext context, Block block)
public IRubyObject lines19(ThreadContext context, Block block)
public IRubyObject each_charInternal(ThreadContext context, Block block)
public IRubyObject each_charInternal19(ThreadContext context, Block block)
public IRubyObject each_char(ThreadContext context, Block block)
public IRubyObject each_char19(ThreadContext context, Block block)
public IRubyObject chars(ThreadContext context, Block block)
public IRubyObject chars19(ThreadContext context, Block block)
public IRubyObject codepoints(ThreadContext context, Block block)
public IRubyObject each_codepoint(ThreadContext context, Block block)
private IRubyObject eachCodePointCommon(ThreadContext context, Block block, java.lang.String methodName)
public RubyIO each_lineInternal(ThreadContext context, IRubyObject[] args, Block block)
Invoke a block for each line.
public IRubyObject each(ThreadContext context, IRubyObject[] args, Block block)
public IRubyObject each_line(ThreadContext context, IRubyObject[] args, Block block)
public RubyArray readlines(ThreadContext context, IRubyObject[] args)
public RubyArray readlines19(ThreadContext context, IRubyObject[] args)
private RubyArray readlinesCommon(ThreadContext context, IRubyObject[] args)
private long getLimitFromArgs(IRubyObject[] args)
public RubyIO to_io()
public java.lang.String toString()
RubyObjecttoString in class RubyObjectprivate static IRubyObject foreachInternal(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
private static IRubyObject foreachInternal19(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
public static IRubyObject foreach(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
public static IRubyObject foreach19(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
public static RubyIO convertToIO(ThreadContext context, IRubyObject obj)
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)
private static RubyIO newFile(ThreadContext context, IRubyObject recv, IRubyObject... args)
private static RubyIO newFile19(ThreadContext context, IRubyObject recv, IRubyObject... args)
public static void failIfDirectory(Ruby runtime, RubyString pathStr)
@Deprecated public static IRubyObject read(ThreadContext context, IRubyObject recv, IRubyObject path, Block unusedBlock)
@Deprecated public static IRubyObject read(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject length)
@Deprecated public static IRubyObject read(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject length, IRubyObject offset)
public static IRubyObject readStatic(ThreadContext context, IRubyObject recv, IRubyObject path)
public static IRubyObject readStatic(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject length)
public static IRubyObject readStatic(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject length, IRubyObject offset)
private static IRubyObject read19(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject length, IRubyObject offset, IRubyObject options)
private static IRubyObject openKeyArgs(ThreadContext context, IRubyObject recv, IRubyObject[] argv, IRubyObject opt)
public static IRubyObject ioOpen(ThreadContext context, IRubyObject filename, IRubyObject vmode, IRubyObject vperm, IRubyObject opt)
public static IRubyObject checkPipeCommand(ThreadContext context, IRubyObject filenameOrCommand)
private static IRubyObject write19(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject str, IRubyObject offset, RubyHash options)
public static IRubyObject binread(ThreadContext context, IRubyObject recv, IRubyObject[] args)
context - the current ThreadContextrecv - the target of the call (IO or a subclass)args - arguments; path [, length [, offset]]public static IRubyObject read19(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block unusedBlock)
public static IRubyObject binwrite(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject writeStatic(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block unusedBlock)
public static IRubyObject readlines(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block unusedBlock)
public static IRubyObject readlines19(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block unusedBlock)
private static IRubyObject[] processReadlinesMethodArguments(IRubyObject[] args)
private static RubyArray readlinesCommon(ThreadContext context, IRubyObject recv, IRubyObject[] openFileArguments, IRubyObject[] methodArguments)
private static RubyArray readlinesCommon19(ThreadContext context, RubyIO file, IRubyObject[] newArguments)
public static IRubyObject popen(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
private void setupPopen(ModeFlags modes, ShellLauncher.POpenProcess process) throws RaiseException
RaiseExceptionpublic static IRubyObject popen19(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
public static IRubyObject popen3(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
public static IRubyObject popen3_19(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
public static IRubyObject popen4(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
private static void cleanupPOpen(RubyIO.POpenTuple tuple)
public static RubyIO.POpenTuple popenSpecial(ThreadContext context, IRubyObject[] args)
public static IRubyObject pipe(ThreadContext context, IRubyObject recv)
public static IRubyObject pipe19(ThreadContext context, IRubyObject recv)
public static IRubyObject pipe19(ThreadContext context, IRubyObject recv, IRubyObject modes)
public static IRubyObject pipe19(ThreadContext context, IRubyObject recv, IRubyObject modes, IRubyObject options)
public static IRubyObject copy_stream(ThreadContext context, IRubyObject recv, IRubyObject[] args)
private static long transfer(java.nio.channels.ReadableByteChannel from,
java.nio.channels.FileChannel to)
throws java.io.IOException
java.io.IOExceptionprivate static long transfer(java.nio.channels.FileChannel from,
java.nio.channels.WritableByteChannel to,
long remaining,
long position)
throws java.io.IOException
java.io.IOExceptionprivate static long transfer(ThreadContext context, java.nio.channels.ReadableByteChannel from, java.nio.channels.WritableByteChannel to) throws java.io.IOException
java.io.IOExceptionpublic static IRubyObject tryConvert(ThreadContext context, IRubyObject recv, IRubyObject arg)
private static org.jruby.util.ByteList getNilByteList(Ruby runtime)
public void addBlockingThread(RubyThread thread)
thread - A thread blocking on this IOpublic void removeBlockingThread(RubyThread thread)
thread - A thread blocking on this IOprotected void interruptBlockingThreads()
protected IOOptions updateIOOptionsFromOptions(ThreadContext context, RubyHash options, IOOptions ioOptions)
public org.jcodings.Encoding encodingFromBOM()
public static void checkExecOptions(IRubyObject options)
options - public static void checkSpawnOptions(IRubyObject options)
options - public static void checkPopenOptions(IRubyObject options)
options - private static void checkUnsupportedOptions(IRubyObject options, java.util.Set<java.lang.String> unsupported, java.lang.String error)
options - private static void checkValidOptions(IRubyObject options, java.util.Set<java.lang.String> valid)
options - public static void obliterateProcess(java.lang.Process process)
process - The process to obliteratepublic boolean writeDataBuffered()
@Deprecated public void registerDescriptor(ChannelDescriptor descriptor, boolean isRetained)
@Deprecated public void registerDescriptor(ChannelDescriptor descriptor)
@Deprecated public void unregisterDescriptor(int aFileno)
@Deprecated public ChannelDescriptor getDescriptorByFileno(int aFileno)
@Deprecated public static int getNewFileno()
@Deprecated public IRubyObject gets(ThreadContext context, IRubyObject[] args)
@Deprecated public IRubyObject readline(ThreadContext context, IRubyObject[] args)
private IRubyObject doWriteConversion(ThreadContext context, IRubyObject str)
private boolean needsReadConversion()
private boolean needsWriteConversion(ThreadContext context)
private void makeReadConversion(ThreadContext context)
private void makeWriteConversion(ThreadContext context)
private void clearReadConversion()
private void clearCodeConversion()
public void setEnc2(org.jcodings.Encoding enc2)
setEnc2 in interface IOEncodablepublic void setEnc(org.jcodings.Encoding enc)
setEnc in interface IOEncodablepublic void setEcflags(int ecflags)
setEcflags in interface IOEncodablepublic int getEcflags()
getEcflags in interface IOEncodablepublic void setEcopts(IRubyObject ecopts)
setEcopts in interface IOEncodablepublic IRubyObject getEcopts()
getEcopts in interface IOEncodablepublic void setBOM(boolean bom)
setBOM in interface IOEncodablepublic boolean getBOM()
getBOM in interface IOEncodableprotected void setAscii8bitBinmode()
protected void MakeOpenFile()
@Deprecated public IRubyObject getline(Ruby runtime, org.jruby.util.ByteList separator)
@Deprecated public IRubyObject getline(Ruby runtime, org.jruby.util.ByteList separator, long limit)