org.jruby.runtime.marshal
Class MarshalStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.jruby.runtime.marshal.MarshalStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class MarshalStream
extends java.io.FilterOutputStream

Marshals objects into Ruby's binary marshal format.

Author:
Anders

Field Summary
static java.lang.String SYMBOL_ENCODING_SPECIAL
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
MarshalStream(Ruby runtime, java.io.OutputStream out, int depthLimit)
           
 
Method Summary
 void dumpDefaultObjectHeader(char tp, RubyClass type)
           
 void dumpDefaultObjectHeader(RubyClass type)
           
 void dumpObject(IRubyObject value)
           
 void dumpSymbol(java.lang.String value)
           
 void dumpVariables(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)
           
 boolean isTainted()
           
 boolean isUntrusted()
           
 void registerLinkTarget(IRubyObject newObject)
           
 void registerSymbol(java.lang.String sym)
           
 void userMarshal(IRubyObject value)
           
 void userMarshal(IRubyObject value, DynamicMethod method)
           
 void userNewMarshal(IRubyObject value)
           
 void userNewMarshal(IRubyObject value, DynamicMethod method)
           
 void writeByte(int value)
           
 void writeDirectly(IRubyObject value)
           
 void writeEncoding(org.jcodings.Encoding encoding)
           
 void writeInt(int value)
           
 void writeString(org.jruby.util.ByteList value)
           
 void writeString(java.lang.String value)
           
 void writeUserClass(IRubyObject obj, RubyClass type)
           
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYMBOL_ENCODING_SPECIAL

public static final java.lang.String SYMBOL_ENCODING_SPECIAL
See Also:
Constant Field Values
Constructor Detail

MarshalStream

public MarshalStream(Ruby runtime,
                     java.io.OutputStream out,
                     int depthLimit)
              throws java.io.IOException
Throws:
java.io.IOException
Method Detail

dumpObject

public void dumpObject(IRubyObject value)
                throws java.io.IOException
Throws:
java.io.IOException

registerLinkTarget

public void registerLinkTarget(IRubyObject newObject)

registerSymbol

public void registerSymbol(java.lang.String sym)

writeDirectly

public void writeDirectly(IRubyObject value)
                   throws java.io.IOException
Throws:
java.io.IOException

getPathFromClass

public static java.lang.String getPathFromClass(RubyModule clazz)

userNewMarshal

public void userNewMarshal(IRubyObject value,
                           DynamicMethod method)
                    throws java.io.IOException
Throws:
java.io.IOException

userNewMarshal

public void userNewMarshal(IRubyObject value)
                    throws java.io.IOException
Throws:
java.io.IOException

userMarshal

public void userMarshal(IRubyObject value,
                        DynamicMethod method)
                 throws java.io.IOException
Throws:
java.io.IOException

userMarshal

public void userMarshal(IRubyObject value)
                 throws java.io.IOException
Throws:
java.io.IOException

writeUserClass

public void writeUserClass(IRubyObject obj,
                           RubyClass type)
                    throws java.io.IOException
Throws:
java.io.IOException

dumpVariablesWithEncoding

public void dumpVariablesWithEncoding(java.util.List<Variable<java.lang.Object>> vars,
                                      IRubyObject obj)
                               throws java.io.IOException
Throws:
java.io.IOException

dumpVariables

public void dumpVariables(java.util.List<Variable<java.lang.Object>> vars)
                   throws java.io.IOException
Throws:
java.io.IOException

writeEncoding

public void writeEncoding(org.jcodings.Encoding encoding)
                   throws java.io.IOException
Throws:
java.io.IOException

dumpDefaultObjectHeader

public void dumpDefaultObjectHeader(RubyClass type)
                             throws java.io.IOException
Throws:
java.io.IOException

dumpDefaultObjectHeader

public void dumpDefaultObjectHeader(char tp,
                                    RubyClass type)
                             throws java.io.IOException
Throws:
java.io.IOException

writeString

public void writeString(java.lang.String value)
                 throws java.io.IOException
Throws:
java.io.IOException

writeString

public void writeString(org.jruby.util.ByteList value)
                 throws java.io.IOException
Throws:
java.io.IOException

dumpSymbol

public void dumpSymbol(java.lang.String value)
                throws java.io.IOException
Throws:
java.io.IOException

writeInt

public void writeInt(int value)
              throws java.io.IOException
Throws:
java.io.IOException

writeByte

public void writeByte(int value)
               throws java.io.IOException
Throws:
java.io.IOException

isTainted

public boolean isTainted()

isUntrusted

public boolean isUntrusted()


Copyright © 2002-2009 JRuby Team. All Rights Reserved.