Package org.jruby.ext.stringio
Class StringIO
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.ext.stringio.StringIO
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,InstanceVariables,InternalVariables,IRubyObject,EncodingCapable,CoreObjectType,DataType
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class(package private) static classNested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final Getline.Callback<StringIO,IRubyObject> private static final Getline.Callback<StringIO,RubyArray> private static final Getline.Callback<StringIO,StringIO> static final ByteList(package private) StringIO.StringIODataprivate static final intprivate static final intprivate static final intFields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORFields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUST_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStampFields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbinmode(ThreadContext context) private static voidbm_init_skip(int[] skip, byte[] pat, int patPtr, int m) private static intbm_search(byte[] little, int lstart, int llen, byte[] big, int bstart, int blen, int[] skip) chars(ThreadContext context, Block block) private voidvoidThe actual method that checks frozen with the default frozen message from MRI.private voidprivate voidprivate voidprivate voidprivate voidprivate static intchompNewlineWidth(byte[] bytes, int s, int e) close(ThreadContext context) close_read(ThreadContext context) close_write(ThreadContext context) private booleanclosed()closed_p()codepoints(ThreadContext context, Block block) static RubyClasscreateStringIOClass(Ruby runtime) each(ThreadContext context, Block block) each(ThreadContext context, IRubyObject[] args, Block block) each(ThreadContext context, IRubyObject arg0, Block block) each(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) each(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) each_byte(ThreadContext context, Block block) each_char(ThreadContext context, Block block) each_codepoint(ThreadContext context, Block block) each_line(ThreadContext context, Block block) each_line(ThreadContext context, IRubyObject[] args, Block block) each_line(ThreadContext context, IRubyObject arg0, Block block) each_line(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) each_line(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) eof(ThreadContext context) external_encoding(ThreadContext context) getbyte(ThreadContext context) getc(ThreadContext context) org.jcodings.Encodingprivate IRubyObjectgetline(ThreadContext context, IRubyObject rs, int limit, boolean chomp) gets(ThreadContext context) gets(ThreadContext context, IRubyObject arg0) gets(ThreadContext context, IRubyObject[] args) gets(ThreadContext context, IRubyObject arg0, IRubyObject arg1) gets(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) initialize(ThreadContext context, IRubyObject[] args) initialize_copy(ThreadContext context, IRubyObject other) internal_encoding(ThreadContext context) private booleanlength()lineno(ThreadContext context) lines(ThreadContext context, IRubyObject[] args, Block block) static IRubyObjectnewInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) static IRubyObjectopen(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) pos(ThreadContext context) putc(ThreadContext context, IRubyObject ch) puts(ThreadContext context, IRubyObject[] args) read(ThreadContext context, IRubyObject[] args) private booleanreadable()readlines(ThreadContext context) readlines(ThreadContext context, IRubyObject arg0) readlines(ThreadContext context, IRubyObject[] args) readlines(ThreadContext context, IRubyObject arg0, IRubyObject arg1) readlines(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) reopen(ThreadContext context, IRubyObject[] args) rewind(ThreadContext context) seek(ThreadContext context, IRubyObject[] args) set_encoding(ThreadContext context, IRubyObject ext_enc) set_encoding(ThreadContext context, IRubyObject enc, IRubyObject ignored) set_encoding(ThreadContext context, IRubyObject enc, IRubyObject ignored1, IRubyObject ignored2) set_lineno(ThreadContext context, IRubyObject arg) set_pos(IRubyObject arg) set_string(IRubyObject arg) voidsetEncoding(org.jcodings.Encoding enc) string(ThreadContext context) private longstringIOWrite(ThreadContext context, Ruby runtime, IRubyObject arg) strio_unimpl(ThreadContext context, IRubyObject[] args) private voidstrioExtend(int pos, int len) strioFalse(ThreadContext context) strioFirst(IRubyObject arg) private voidstrioInit(ThreadContext context, IRubyObject[] args) strioNil(ThreadContext context) private RubyStringstrioSubstr(Ruby runtime, int pos, int len, org.jcodings.Encoding enc) strioZero(ThreadContext context) sync(ThreadContext context) sysread(IRubyObject[] args) truncate(IRubyObject len) ungetbyte(ThreadContext context, IRubyObject arg) private voidungetbyteCommon(byte[] ungetBytes, int ungetBegin, int ungetLen) private voidungetbyteCommon(int c) private voidungetbyteCommon(RubyString ungetBytes) ungetc(ThreadContext context, IRubyObject arg) private booleanwritable()write(ThreadContext context, IRubyObject arg) write(ThreadContext context, IRubyObject[] args) Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, dig1, dig2, eqlInternal, equalInternal, equals, getNativeClassIndex, hashCode, inspect, op_eqq, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dup, ensureInstanceVariablesSettable, eql, eql_p, 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, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize_copy, initialize19, inspect, 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, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method, method_missing, method_missing19, method19, methods, methods, methods19, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_equal, op_equal_19, op_match, op_match19, op_not, op_not_equal, op_not_match, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, rbClone, rbInspect, 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, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_a, to_s, toJava, trust, type, type_deprecated, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
-
Field Details
-
ptr
-
STRIO_READABLE
private static final int STRIO_READABLE -
STRIO_WRITABLE
private static final int STRIO_WRITABLE -
STRIO_READWRITE
private static final int STRIO_READWRITE -
CHAR_BIT
private static final int CHAR_BIT- See Also:
-
GETLINE
-
GETLINE_YIELD
-
GETLINE_ARY
-
NEWLINE
-
-
Constructor Details
-
StringIO
-
-
Method Details
-
createStringIOClass
-
getEncoding
public org.jcodings.Encoding getEncoding()- Specified by:
getEncodingin interfaceEncodingCapable
-
setEncoding
public void setEncoding(org.jcodings.Encoding enc) - Specified by:
setEncodingin interfaceEncodingCapable
-
newInstance
public static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) -
open
public static IRubyObject open(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) -
initialize
-
strioInit
-
initialize_copy
-
binmode
-
strio_self
-
strio_unimpl
-
strioZero
-
strioFirst
-
strioFalse
-
strioNil
-
close
-
closed_p
-
close_read
-
closed_read_p
-
close_write
-
closed_write_p
-
each
-
each
-
each
-
each
public IRubyObject each(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) -
each
-
each_line
-
each_line
-
each_line
public IRubyObject each_line(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) -
each_line
public IRubyObject each_line(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) -
each_line
-
lines
-
each_byte
-
each_char
-
chars
-
eof
-
isEndOfString
private boolean isEndOfString() -
getc
-
getbyte
-
strioSubstr
-
bm_init_skip
private static void bm_init_skip(int[] skip, byte[] pat, int patPtr, int m) -
bm_search
private static int bm_search(byte[] little, int lstart, int llen, byte[] big, int bstart, int blen, int[] skip) -
gets
-
gets
-
gets
-
gets
public IRubyObject gets(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) -
gets
-
getline
-
chompNewlineWidth
private static int chompNewlineWidth(byte[] bytes, int s, int e) -
length
-
lineno
-
set_lineno
-
pos
-
set_pos
-
strioExtend
private void strioExtend(int pos, int len) -
putc
-
read
-
readlines
-
readlines
-
readlines
-
readlines
public IRubyObject readlines(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) -
readlines
-
reopen
-
rewind
-
seek
-
set_string
-
string
-
sync
-
sysread
-
truncate
-
ungetc
-
ungetbyteCommon
private void ungetbyteCommon(int c) -
ungetbyteCommon
-
ungetbyteCommon
private void ungetbyteCommon(byte[] ungetBytes, int ungetBegin, int ungetLen) -
ungetbyte
-
write
-
write
-
stringIOWrite
-
set_encoding
-
set_encoding
-
set_encoding
public IRubyObject set_encoding(ThreadContext context, IRubyObject enc, IRubyObject ignored1, IRubyObject ignored2) -
external_encoding
-
internal_encoding
-
each_codepoint
-
codepoints
-
puts
-
checkFrozen
public void checkFrozen()Description copied from class:RubyBasicObjectThe actual method that checks frozen with the default frozen message from MRI. If possible, call this instead ofRubyBasicObject.testFrozen(java.lang.String).- Overrides:
checkFrozenin classRubyBasicObject
-
readable
private boolean readable() -
writable
private boolean writable() -
closed
private boolean closed() -
checkReadable
private void checkReadable() -
checkWritable
private void checkWritable() -
checkModifiable
private void checkModifiable() -
checkInitialized
private void checkInitialized() -
checkFinalized
private void checkFinalized() -
checkOpen
private void checkOpen()
-