com.caucho.json
Class JsonOutput

java.lang.Object
  extended by com.caucho.json.JsonOutput

public class JsonOutput
extends java.lang.Object

Abstract output stream for JSON requests.

 OutputStream os = ...; // from http connection
 AbstractOutput out = new HessianSerializerOutput(os);
 String value;

 out.startCall("hello");  // start hello call
 out.writeString("arg1"); // write a string argument
 out.completeCall();      // complete the call
 


Constructor Summary
JsonOutput()
           
JsonOutput(java.io.PrintWriter os)
           
 
Method Summary
 void close()
           
 void flush()
           
 void flushBuffer()
           
 void init(java.io.PrintWriter os)
          Initialize the output with a new underlying stream.
 void writeArrayBegin()
           
 void writeArrayComma()
           
 void writeArrayEnd()
           
 void writeBoolean(boolean value)
           
 void writeDouble(double value)
           
 void writeLong(long value)
           
 void writeMapBegin()
           
 void writeMapComma()
           
 void writeMapEnd()
           
 void writeMapEntry(java.lang.String key, java.lang.Object value)
           
 void writeNull()
           
 void writeObject(java.io.Serializable value)
           
 void writeString(char[] v, int offset, int length)
           
 void writeString(java.lang.String v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonOutput

public JsonOutput()

JsonOutput

public JsonOutput(java.io.PrintWriter os)
Method Detail

init

public void init(java.io.PrintWriter os)
Initialize the output with a new underlying stream.


writeObject

public void writeObject(java.io.Serializable value)
                 throws java.io.IOException
Throws:
java.io.IOException

writeNull

public void writeNull()
               throws java.io.IOException
Throws:
java.io.IOException

writeBoolean

public void writeBoolean(boolean value)
                  throws java.io.IOException
Throws:
java.io.IOException

writeLong

public void writeLong(long value)
               throws java.io.IOException
Throws:
java.io.IOException

writeDouble

public void writeDouble(double value)
                 throws java.io.IOException
Throws:
java.io.IOException

writeString

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

writeString

public void writeString(char[] v,
                        int offset,
                        int length)
                 throws java.io.IOException
Throws:
java.io.IOException

writeArrayBegin

public void writeArrayBegin()
                     throws java.io.IOException
Throws:
java.io.IOException

writeArrayComma

public void writeArrayComma()
                     throws java.io.IOException
Throws:
java.io.IOException

writeArrayEnd

public void writeArrayEnd()
                   throws java.io.IOException
Throws:
java.io.IOException

writeMapBegin

public void writeMapBegin()
                   throws java.io.IOException
Throws:
java.io.IOException

writeMapComma

public void writeMapComma()
                   throws java.io.IOException
Throws:
java.io.IOException

writeMapEntry

public void writeMapEntry(java.lang.String key,
                          java.lang.Object value)
                   throws java.io.IOException
Throws:
java.io.IOException

writeMapEnd

public void writeMapEnd()
                 throws java.io.IOException
Throws:
java.io.IOException

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException