Package org.jruby.runtime.marshal
Class MarshalStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.jruby.runtime.marshal.MarshalStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Marshals objects into Ruby's binary marshal format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MarshalCacheprivate intprivate final intprivate final Rubyprivate static final Stringstatic final Stringprivate booleanprivate static final charprivate static final charprivate static final charprivate static final charFields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddumpDefaultObjectHeader(char tp, RubyClass type) voidprivate RubyClassdumpExtended(RubyClass type) w_extendedvoiddumpObject(IRubyObject value) voiddumpSymbol(ByteList value) voiddumpVariables(List<Variable<Object>> vars) private voiddumpVariablesShared(List<Variable<Object>> vars) voiddumpVariablesWithEncoding(List<Variable<Object>> vars, IRubyObject obj) static StringgetPathFromClass(RubyModule clazz) getVariables(IRubyObject value) private booleanhasSingletonMethods(RubyClass type) private static booleanisMarshalFixnum(RubyFixnum fixnum) booleanbooleanDeprecated.voidregisterLinkTarget(IRubyObject newObject) voidregisterSymbol(ByteList sym) (package private) static booleanshouldBeRegistered(IRubyObject value) private static booleanshouldMarshalEncoding(IRubyObject value) private voiduserCommon(IRubyObject value, CacheEntry entry) voiduserMarshal(IRubyObject value) voiduserMarshal(IRubyObject value, CacheEntry entry) private voiduserNewCommon(IRubyObject value, CacheEntry entry) voiduserNewMarshal(IRubyObject value) voiduserNewMarshal(IRubyObject value, CacheEntry entry) private voidwriteAndRegister(IRubyObject value) private voidvoidwriteByte(int value) voidwriteDirectly(IRubyObject value) voidwriteEncoding(org.jcodings.Encoding encoding) voidwriteInt(int value) private voidwriteObjectData(IRubyObject value) voidwriteString(String value) voidwriteString(ByteList value) voidwriteUserClass(IRubyObject obj, RubyClass type) Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
runtime
-
cache
-
depthLimit
private final int depthLimit -
tainted
private boolean tainted -
depth
private int depth -
TYPE_IVAR
private static final char TYPE_IVAR- See Also:
-
TYPE_USRMARSHAL
private static final char TYPE_USRMARSHAL- See Also:
-
TYPE_USERDEF
private static final char TYPE_USERDEF- See Also:
-
TYPE_UCLASS
private static final char TYPE_UCLASS- See Also:
-
SYMBOL_ENCODING_SPECIAL
- See Also:
-
SYMBOL_ENCODING
- See Also:
-
-
Constructor Details
-
MarshalStream
- Throws:
IOException
-
-
Method Details
-
dumpObject
- Throws:
IOException
-
registerLinkTarget
-
registerSymbol
-
shouldBeRegistered
-
isMarshalFixnum
-
writeAndRegisterSymbol
- Throws:
IOException
-
writeAndRegister
- Throws:
IOException
-
getVariables
- Throws:
IOException
-
shouldMarshalEncoding
-
writeDirectly
- Throws:
IOException
-
getPathFromClass
-
writeObjectData
- Throws:
IOException
-
userNewMarshal
- Throws:
IOException
-
userNewMarshal
- Throws:
IOException
-
userNewCommon
- Throws:
IOException
-
userMarshal
- Throws:
IOException
-
userMarshal
- Throws:
IOException
-
userCommon
- Throws:
IOException
-
writeUserClass
- Throws:
IOException
-
dumpVariablesWithEncoding
public void dumpVariablesWithEncoding(List<Variable<Object>> vars, IRubyObject obj) throws IOException - Throws:
IOException
-
dumpVariables
- Throws:
IOException
-
writeEncoding
- Throws:
IOException
-
hasSingletonMethods
-
dumpExtended
w_extended- Throws:
IOException
-
dumpDefaultObjectHeader
- Throws:
IOException
-
dumpDefaultObjectHeader
- Throws:
IOException
-
writeString
- Throws:
IOException
-
writeString
- Throws:
IOException
-
dumpSymbol
- Throws:
IOException
-
writeInt
- Throws:
IOException
-
writeByte
- Throws:
IOException
-
isTainted
public boolean isTainted() -
isUntrusted
Deprecated.
-