|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectcom.caucho.burlap.client.MicroBurlapOutput
public class MicroBurlapOutput
Output stream for Burlap requests, compatible with microedition Java. It only uses classes and types available to J2ME. In particular, it does not have any support for the <double> type.
MicroBurlapOutput does not depend on any classes other than in J2ME, so it can be extracted independently into a smaller package.
MicroBurlapOutput is unbuffered, so any client needs to provide its own buffering.
OutputStream os = ...; // from http connection MicroBurlapOutput out = new MicroBurlapOutput(os); String value; out.startCall("hello"); // start hello call out.writeString("arg1"); // write a string argument out.completeCall(); // complete the call
构造方法摘要 | |
---|---|
MicroBurlapOutput()
Creates an uninitialized Burlap output stream. |
|
MicroBurlapOutput(java.io.OutputStream os)
Creates a new Burlap output stream, initialized with an underlying output stream. |
方法摘要 | |
---|---|
static char |
base64encode(int d)
Converts the digit to its base64 encoding. |
void |
call(java.lang.String method,
java.lang.Object[] args)
Writes a complete method call. |
void |
completeCall()
Writes the method call:
</burlap:request>
|
void |
init(java.io.OutputStream os)
|
void |
print(java.lang.String s)
Prints a string as ascii to the stream. |
void |
printBytes(byte[] data,
int offset,
int length)
Prints a byte array to the stream, properly encoded in base64. |
void |
printDate(java.util.Calendar calendar)
Prints a date. |
void |
printInt(int v)
Prints an integer to the stream. |
void |
printLong(long v)
Prints a long to the stream. |
void |
printString(java.lang.String v)
Prints a string to the stream, properly encoded. |
void |
startCall(java.lang.String method)
Writes the method call:
<burlap:request>
<method>add</method>
|
void |
writeBoolean(boolean value)
Writes a boolean value to the stream. |
void |
writeBytes(byte[] buffer,
int offset,
int length)
Writes a byte array to the stream using base64 encoding. |
void |
writeCustomObject(java.lang.Object object)
Applications which override this can do custom serialization. |
void |
writeInt(int value)
Writes an integer value to the stream. |
void |
writeListBegin(int length,
java.lang.String type)
Writes the list header to the stream. |
void |
writeListEnd()
Writes the tail of the list to the stream. |
void |
writeLocalDate(long time)
Writes a date to the stream using ISO8609. |
void |
writeLong(long value)
Writes a long value to the stream. |
void |
writeMapBegin(java.lang.String type)
Writes the map header to the stream. |
void |
writeMapEnd()
Writes the tail of the map to the stream. |
void |
writeNull()
Writes a null value to the stream. |
void |
writeObject(java.lang.Object object)
Writes a generic object. |
void |
writeRef(int value)
Writes a reference. |
void |
writeRemote(java.lang.String type,
java.lang.String url)
Writes a remote object reference to the stream. |
void |
writeString(java.lang.String value)
Writes a string value to the stream using UTF-8 encoding. |
void |
writeUTCDate(long time)
Writes a date to the stream using ISO8609. |
从类 java.lang.Object 继承的方法 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public MicroBurlapOutput(java.io.OutputStream os)
os
- the underlying output stream.public MicroBurlapOutput()
方法详细信息 |
---|
public void init(java.io.OutputStream os)
public void call(java.lang.String method, java.lang.Object[] args) throws java.io.IOException
java.io.IOException
public void startCall(java.lang.String method) throws java.io.IOException
<burlap:request>
<method>add</method>
method
- the method name to call.
java.io.IOException
public void completeCall() throws java.io.IOException
</burlap:request>
java.io.IOException
public void writeBoolean(boolean value) throws java.io.IOException
<boolean>1</boolean>
value
- the boolean value to write.
java.io.IOException
public void writeInt(int value) throws java.io.IOException
<int>123</int>
value
- the integer value to write.
java.io.IOException
public void writeLong(long value) throws java.io.IOException
<long>123</long>
value
- the long value to write.
java.io.IOException
public void writeNull() throws java.io.IOException
<null></null>
value
- the string value to write.
java.io.IOException
public void writeString(java.lang.String value) throws java.io.IOException
<string>12.3e10</string>
If the value is null, it will be written as
<null></null>
value
- the string value to write.
java.io.IOException
public void writeBytes(byte[] buffer, int offset, int length) throws java.io.IOException
<base64>dJmO==</base64>
If the value is null, it will be written as
<null></null>
value
- the string value to write.
java.io.IOException
public void writeUTCDate(long time) throws java.io.IOException
<date>19980508T095131Z</date>
value
- the date in milliseconds from the epoch in UTC
java.io.IOException
public void writeLocalDate(long time) throws java.io.IOException
<date>19980508T095131Z</date>
value
- the date in milliseconds from the epoch in local timezone
java.io.IOException
public void writeRef(int value) throws java.io.IOException
<ref>123</ref>
value
- the integer value to write.
java.io.IOException
public void writeObject(java.lang.Object object) throws java.io.IOException
writeCustomObject
.
java.io.IOException
public void writeCustomObject(java.lang.Object object) throws java.io.IOException
object
- the object to write.
java.io.IOException
public void writeListBegin(int length, java.lang.String type) throws java.io.IOException
writeListBegin
followed by the list contents and then
call writeListEnd
.
<list>
<type>java.util.ArrayList</type>
<length>3</length>
<int>1</int>
<int>2</int>
<int>3</int>
</list>
java.io.IOException
public void writeListEnd() throws java.io.IOException
java.io.IOException
public void writeMapBegin(java.lang.String type) throws java.io.IOException
writeMapBegin
followed by the map contents and then
call writeMapEnd
.
<map>
<type>java.util.Hashtable</type>
<string>a</string;<int>1</int>
<string>b</string;<int>2</int>
<string>c</string;<int>3</int>
</map>
java.io.IOException
public void writeMapEnd() throws java.io.IOException
java.io.IOException
public void writeRemote(java.lang.String type, java.lang.String url) throws java.io.IOException
<remote>
<type>test.account.Account</type>
<string>http://caucho.com/foo;ejbid=bar</string>
</remote>
java.io.IOException
public void printInt(int v) throws java.io.IOException
v
- the integer to print.
java.io.IOException
public void printLong(long v) throws java.io.IOException
v
- the long to print.
java.io.IOException
public void printString(java.lang.String v) throws java.io.IOException
v
- the string to print.
java.io.IOException
public void printBytes(byte[] data, int offset, int length) throws java.io.IOException
data
- the bytes to print.
java.io.IOException
public static char base64encode(int d)
public void printDate(java.util.Calendar calendar) throws java.io.IOException
date
- the date to print.
java.io.IOException
public void print(java.lang.String s) throws java.io.IOException
s
- the ascii string to print.
java.io.IOException
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |