public class MarshalStream
extends java.io.FilterOutputStream
| Modifier and Type | Field and Description |
|---|---|
private MarshalCache |
cache |
private int |
depth |
private int |
depthLimit |
private Ruby |
runtime |
private static java.lang.String |
SYMBOL_ENCODING |
static java.lang.String |
SYMBOL_ENCODING_SPECIAL |
private boolean |
tainted |
private static char |
TYPE_IVAR |
private static char |
TYPE_UCLASS |
private static char |
TYPE_USERDEF |
private static char |
TYPE_USRMARSHAL |
private boolean |
untrusted |
| Constructor and Description |
|---|
MarshalStream(Ruby runtime,
java.io.OutputStream out,
int depthLimit) |
| Modifier and Type | Method and Description |
|---|---|
void |
dumpDefaultObjectHeader(char tp,
RubyClass type) |
void |
dumpDefaultObjectHeader(RubyClass type) |
private RubyClass |
dumpExtended(RubyClass type)
w_extended
|
void |
dumpObject(IRubyObject value) |
void |
dumpSymbol(java.lang.String value) |
void |
dumpVariables(java.util.List<Variable<java.lang.Object>> vars) |
private void |
dumpVariablesShared(java.util.List<Variable<java.lang.Object>> vars) |
void |
dumpVariablesWithEncoding(java.util.List<Variable<java.lang.Object>> vars,
IRubyObject obj) |
static java.lang.String |
getPathFromClass(RubyModule clazz) |
private java.util.List<Variable<java.lang.Object>> |
getVariables(IRubyObject value) |
private boolean |
hasSingletonMethods(RubyClass type) |
private static boolean |
isMarshalFixnum(RubyFixnum fixnum) |
boolean |
isTainted() |
boolean |
isUntrusted() |
void |
registerLinkTarget(IRubyObject newObject) |
void |
registerSymbol(java.lang.String sym) |
(package private) static boolean |
shouldBeRegistered(IRubyObject value) |
private boolean |
shouldMarshalEncoding(IRubyObject value) |
private void |
userCommon(IRubyObject value,
DynamicMethod method) |
void |
userMarshal(IRubyObject value) |
void |
userMarshal(IRubyObject value,
DynamicMethod method) |
private void |
userNewCommon(IRubyObject value,
DynamicMethod method) |
void |
userNewMarshal(IRubyObject value) |
void |
userNewMarshal(IRubyObject value,
DynamicMethod method) |
private void |
writeAndRegister(IRubyObject value) |
private void |
writeAndRegisterSymbol(java.lang.String sym) |
void |
writeByte(int value) |
void |
writeDirectly(IRubyObject value) |
void |
writeEncoding(org.jcodings.Encoding encoding) |
void |
writeInt(int value) |
private void |
writeObjectData(IRubyObject value) |
void |
writeString(org.jruby.util.ByteList value) |
void |
writeString(java.lang.String value) |
void |
writeUserClass(IRubyObject obj,
RubyClass type) |
private final Ruby runtime
private final MarshalCache cache
private final int depthLimit
private boolean tainted
private boolean untrusted
private int depth
private static final char TYPE_IVAR
private static final char TYPE_USRMARSHAL
private static final char TYPE_USERDEF
private static final char TYPE_UCLASS
public static final java.lang.String SYMBOL_ENCODING_SPECIAL
private static final java.lang.String SYMBOL_ENCODING
public MarshalStream(Ruby runtime, java.io.OutputStream out, int depthLimit) throws java.io.IOException
java.io.IOExceptionpublic void dumpObject(IRubyObject value) throws java.io.IOException
java.io.IOExceptionpublic void registerLinkTarget(IRubyObject newObject)
public void registerSymbol(java.lang.String sym)
static boolean shouldBeRegistered(IRubyObject value)
private static boolean isMarshalFixnum(RubyFixnum fixnum)
private void writeAndRegisterSymbol(java.lang.String sym)
throws java.io.IOException
java.io.IOExceptionprivate void writeAndRegister(IRubyObject value) throws java.io.IOException
java.io.IOExceptionprivate java.util.List<Variable<java.lang.Object>> getVariables(IRubyObject value) throws java.io.IOException
java.io.IOExceptionprivate boolean shouldMarshalEncoding(IRubyObject value)
public void writeDirectly(IRubyObject value) throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String getPathFromClass(RubyModule clazz)
private void writeObjectData(IRubyObject value) throws java.io.IOException
java.io.IOExceptionpublic void userNewMarshal(IRubyObject value, DynamicMethod method) throws java.io.IOException
java.io.IOExceptionpublic void userNewMarshal(IRubyObject value) throws java.io.IOException
java.io.IOExceptionprivate void userNewCommon(IRubyObject value, DynamicMethod method) throws java.io.IOException
java.io.IOExceptionpublic void userMarshal(IRubyObject value, DynamicMethod method) throws java.io.IOException
java.io.IOExceptionpublic void userMarshal(IRubyObject value) throws java.io.IOException
java.io.IOExceptionprivate void userCommon(IRubyObject value, DynamicMethod method) throws java.io.IOException
java.io.IOExceptionpublic void writeUserClass(IRubyObject obj, RubyClass type) throws java.io.IOException
java.io.IOExceptionpublic void dumpVariablesWithEncoding(java.util.List<Variable<java.lang.Object>> vars, IRubyObject obj) throws java.io.IOException
java.io.IOExceptionpublic void dumpVariables(java.util.List<Variable<java.lang.Object>> vars) throws java.io.IOException
java.io.IOExceptionprivate void dumpVariablesShared(java.util.List<Variable<java.lang.Object>> vars) throws java.io.IOException
java.io.IOExceptionpublic void writeEncoding(org.jcodings.Encoding encoding)
throws java.io.IOException
java.io.IOExceptionprivate boolean hasSingletonMethods(RubyClass type)
private RubyClass dumpExtended(RubyClass type) throws java.io.IOException
java.io.IOExceptionpublic void dumpDefaultObjectHeader(RubyClass type) throws java.io.IOException
java.io.IOExceptionpublic void dumpDefaultObjectHeader(char tp,
RubyClass type)
throws java.io.IOException
java.io.IOExceptionpublic void writeString(java.lang.String value)
throws java.io.IOException
java.io.IOExceptionpublic void writeString(org.jruby.util.ByteList value)
throws java.io.IOException
java.io.IOExceptionpublic void dumpSymbol(java.lang.String value)
throws java.io.IOException
java.io.IOExceptionpublic void writeInt(int value)
throws java.io.IOException
java.io.IOExceptionpublic void writeByte(int value)
throws java.io.IOException
java.io.IOExceptionpublic boolean isTainted()
public boolean isUntrusted()