|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.hessian.io.AbstractHessianInput
com.caucho.burlap.io.AbstractBurlapInput
com.caucho.burlap.io.BurlapInput
public class BurlapInput
Input stream for Burlap requests.
BurlapInput is unbuffered, so any client needs to provide its own buffering.
InputStream is = ...; // from http connection BurlapInput in = new BurlapInput(is); String value; in.startReply(); // read reply header value = in.readString(); // read string value in.completeReply(); // read reply footer
| Field Summary | |
|---|---|
protected StringBuffer |
_entityBuffer
|
protected Calendar |
_localCalendar
|
protected int |
_peek
|
protected ArrayList |
_refs
|
protected StringBuffer |
_sbuf
|
protected SerializerFactory |
_serializerFactory
|
protected Calendar |
_utcCalendar
|
static int |
TAG_BASE64
|
static int |
TAG_BASE64_END
|
static int |
TAG_BOOLEAN
|
static int |
TAG_BOOLEAN_END
|
static int |
TAG_CALL
|
static int |
TAG_CALL_END
|
static int |
TAG_DATE
|
static int |
TAG_DATE_END
|
static int |
TAG_DOUBLE
|
static int |
TAG_DOUBLE_END
|
static int |
TAG_EOF
|
static int |
TAG_FAULT
|
static int |
TAG_FAULT_END
|
static int |
TAG_HEADER
|
static int |
TAG_HEADER_END
|
static int |
TAG_INT
|
static int |
TAG_INT_END
|
static int |
TAG_LENGTH
|
static int |
TAG_LENGTH_END
|
static int |
TAG_LIST
|
static int |
TAG_LIST_END
|
static int |
TAG_LONG
|
static int |
TAG_LONG_END
|
static int |
TAG_MAP
|
static int |
TAG_MAP_END
|
static int |
TAG_METHOD
|
static int |
TAG_METHOD_END
|
static int |
TAG_NULL
|
static int |
TAG_NULL_END
|
static int |
TAG_REF
|
static int |
TAG_REF_END
|
static int |
TAG_REMOTE
|
static int |
TAG_REMOTE_END
|
static int |
TAG_REPLY
|
static int |
TAG_REPLY_END
|
static int |
TAG_STRING
|
static int |
TAG_STRING_END
|
static int |
TAG_TYPE
|
static int |
TAG_TYPE_END
|
static int |
TAG_XML
|
static int |
TAG_XML_END
|
| Constructor Summary | |
|---|---|
BurlapInput()
Creates an uninitialized Burlap input stream. |
|
BurlapInput(InputStream is)
Creates a new Burlap input stream, initialized with an underlying input stream. |
|
| Method Summary | |
|---|---|
int |
addRef(Object ref)
Adds a list/map reference. |
void |
completeCall()
Completes reading the call A successful completion will have a single value: </burlap:call> |
void |
completeReply()
Completes reading the call A successful completion will have a single value: </burlap:reply> |
protected IOException |
error(String message)
|
protected IOException |
expectBeginTag(String expect,
String tag)
|
protected IOException |
expectedChar(String expect,
int ch)
|
protected IOException |
expectedTag(String expect,
int tag)
|
void |
expectTag(int expectTag)
|
InputStream |
getInputStream()
|
String |
getMethod()
Returns the calls method |
Reader |
getReader()
Starts reading a string. |
Throwable |
getReplyFault()
Returns any reply fault. |
SerializerFactory |
getSerializerFactory()
Gets the serializer factory. |
void |
init(InputStream is)
Initialize the burlap stream with the underlying input stream. |
boolean |
isEnd()
Returns true if this is the end of a list or a map. |
protected boolean |
isWhitespace(int ch)
|
protected byte[] |
parseBytes()
Parses a byte array. |
protected ByteArrayOutputStream |
parseBytes(ByteArrayOutputStream bos)
Parses a byte array. |
protected long |
parseDate()
Parses a date value from the stream. |
protected long |
parseDate(Calendar calendar)
Parses a date value from the stream. |
protected String |
parseString()
|
protected StringBuffer |
parseString(StringBuffer sbuf)
Parses a string value from the stream. |
protected int |
parseTag()
Parses a tag. |
boolean |
readBoolean()
Reads a boolean <boolean>0</boolean> <boolean>1</boolean> |
byte |
readByte()
Reads a byte <int>value</int> |
byte[] |
readBytes()
Reads a byte array <base64>... |
int |
readCall()
Starts reading the call A successful completion will have a single value: <burlap:call> |
double |
readDouble()
Reads a double <double>value</double> |
void |
readEnd()
Reads the end byte. |
float |
readFloat()
Reads a float <double>value</double> |
String |
readHeader()
Reads a header, returning null if there are no headers. |
InputStream |
readInputStream()
Starts reading a byte array using an input stream. |
int |
readInt()
Reads an integer <int>value</int> |
int |
readLength()
Reads a length <length>value</length> |
void |
readListEnd()
Reads the end of the map |
int |
readListStart()
Reads the start of a list. |
long |
readLocalDate()
Reads a date. |
long |
readLong()
Reads a long <long>value</long> |
void |
readMapEnd()
Reads the end of the map |
int |
readMapStart()
Reads the start of a map. |
String |
readMethod()
Reads the method <method>method</method> |
Node |
readNode()
Reads an XML node. |
void |
readNull()
Reads a null <null></null> |
Object |
readObject()
Reads an arbitrary object from the input stream when the type is unknown. |
Object |
readObject(Class cl)
Reads an object from the input stream with an expected type. |
Object |
readRef()
Reads a reference. |
Object |
readRemote()
Reads a remote object. |
Object |
readReply(Class expectedClass)
Reads a reply as an object. |
short |
readShort()
Reads a short <int>value</int> |
String |
readString()
Reads a string <string>value</string> |
String |
readType()
Parses a type from the stream. |
long |
readUTCDate()
Reads a date. |
Object |
resolveRemote(String type,
String url)
Resolves a remote object. |
void |
setRef(int i,
Object ref)
Adds a list/map reference. |
void |
setSerializerFactory(SerializerFactory factory)
Sets the serializer factory. |
protected int |
skipWhitespace()
|
void |
startCall()
Starts reading the call <burlap:call> <method>method</method> |
void |
startReply()
Starts reading the reply A successful completion will have a single value: <burlap:reply> <value> |
protected static String |
tagName(int tag)
|
| Methods inherited from class com.caucho.hessian.io.AbstractHessianInput |
|---|
close, getRemoteResolver, readMethodArgLength, readToOutputStream, resetReferences, setRemoteResolver, skipOptionalCall, startReplyBody |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TAG_EOF
public static final int TAG_NULL
public static final int TAG_BOOLEAN
public static final int TAG_INT
public static final int TAG_LONG
public static final int TAG_DOUBLE
public static final int TAG_DATE
public static final int TAG_STRING
public static final int TAG_XML
public static final int TAG_BASE64
public static final int TAG_MAP
public static final int TAG_LIST
public static final int TAG_TYPE
public static final int TAG_LENGTH
public static final int TAG_REF
public static final int TAG_REMOTE
public static final int TAG_CALL
public static final int TAG_REPLY
public static final int TAG_FAULT
public static final int TAG_METHOD
public static final int TAG_HEADER
public static final int TAG_NULL_END
public static final int TAG_BOOLEAN_END
public static final int TAG_INT_END
public static final int TAG_LONG_END
public static final int TAG_DOUBLE_END
public static final int TAG_DATE_END
public static final int TAG_STRING_END
public static final int TAG_XML_END
public static final int TAG_BASE64_END
public static final int TAG_MAP_END
public static final int TAG_LIST_END
public static final int TAG_TYPE_END
public static final int TAG_LENGTH_END
public static final int TAG_REF_END
public static final int TAG_REMOTE_END
public static final int TAG_CALL_END
public static final int TAG_REPLY_END
public static final int TAG_FAULT_END
public static final int TAG_METHOD_END
public static final int TAG_HEADER_END
protected SerializerFactory _serializerFactory
protected ArrayList _refs
protected int _peek
protected StringBuffer _sbuf
protected StringBuffer _entityBuffer
protected Calendar _utcCalendar
protected Calendar _localCalendar
| Constructor Detail |
|---|
public BurlapInput()
public BurlapInput(InputStream is)
is - the underlying input stream.| Method Detail |
|---|
public void setSerializerFactory(SerializerFactory factory)
setSerializerFactory in class AbstractHessianInputpublic SerializerFactory getSerializerFactory()
public void init(InputStream is)
init in class AbstractHessianInputpublic String getMethod()
getMethod in class AbstractHessianInputpublic Throwable getReplyFault()
public void startCall()
throws IOException
<burlap:call> <method>method</method>
startCall in class AbstractHessianInputIOException
public int readCall()
throws IOException
A successful completion will have a single value:
<burlap:call>
readCall in class AbstractHessianInputIOException
public String readMethod()
throws IOException
<method>method</method>
readMethod in class AbstractHessianInputIOException
public void completeCall()
throws IOException
A successful completion will have a single value:
</burlap:call>
completeCall in class AbstractHessianInputIOException
public Object readReply(Class expectedClass)
throws Throwable
readReply in class AbstractHessianInputThrowable
public void startReply()
throws Throwable
A successful completion will have a single value:
<burlap:reply> <value>
startReply in class AbstractHessianInputThrowable
public void completeReply()
throws IOException
A successful completion will have a single value:
</burlap:reply>
completeReply in class AbstractHessianInputIOException
public String readHeader()
throws IOException
<header>value</header>
readHeader in class AbstractHessianInputIOException
public void readNull()
throws IOException
<null></null>
readNull in class AbstractHessianInputIOException
public boolean readBoolean()
throws IOException
<boolean>0</boolean> <boolean>1</boolean>
readBoolean in class AbstractHessianInputIOException
public byte readByte()
throws IOException
<int>value</int>
IOException
public short readShort()
throws IOException
<int>value</int>
IOException
public int readInt()
throws IOException
<int>value</int>
readInt in class AbstractHessianInputIOException
public long readLong()
throws IOException
<long>value</long>
readLong in class AbstractHessianInputIOException
public float readFloat()
throws IOException
<double>value</double>
IOException
public double readDouble()
throws IOException
<double>value</double>
readDouble in class AbstractHessianInputIOException
public long readUTCDate()
throws IOException
<date>ISO-8609 date</date>
readUTCDate in class AbstractHessianInputIOException
public long readLocalDate()
throws IOException
<date>ISO-8609 date</date>
IOException
public String readString()
throws IOException
<string>value</string>
readString in class AbstractHessianInputIOException
public Node readNode()
throws IOException
&xml;xml string</xml>
readNode in class AbstractHessianInputIOException
public byte[] readBytes()
throws IOException
<base64>...</base64>
readBytes in class AbstractHessianInputIOException
public int readLength()
throws IOException
<length>value</length>
readLength in class AbstractHessianInputIOException
public Object readObject(Class cl)
throws IOException
readObject in class AbstractHessianInputcl - the expected class if the protocol doesn't supply it.
IOException
public Object readObject()
throws IOException
readObject in class AbstractHessianInputIOException
public Object readRemote()
throws IOException
readRemote in class AbstractHessianInputIOException
public Object readRef()
throws IOException
readRef in class AbstractHessianInputIOException
public int readListStart()
throws IOException
readListStart in class AbstractHessianInputIOException
public int readMapStart()
throws IOException
readMapStart in class AbstractHessianInputIOException
public boolean isEnd()
throws IOException
isEnd in class AbstractHessianInputIOException
public void readEnd()
throws IOException
readEnd in class AbstractHessianInputIOException
public void readMapEnd()
throws IOException
readMapEnd in class AbstractHessianInputIOException
public void readListEnd()
throws IOException
readListEnd in class AbstractHessianInputIOExceptionpublic int addRef(Object ref)
addRef in class AbstractHessianInput
public void setRef(int i,
Object ref)
setRef in class AbstractHessianInput
public Object resolveRemote(String type,
String url)
throws IOException
IOException
public String readType()
throws IOException
<type>type</type>
readType in class AbstractHessianInputIOException
protected long parseDate()
throws IOException
IOException
protected long parseDate(Calendar calendar)
throws IOException
IOException
protected String parseString()
throws IOException
IOException
protected StringBuffer parseString(StringBuffer sbuf)
throws IOException
IOException
protected byte[] parseBytes()
throws IOException
IOException
protected ByteArrayOutputStream parseBytes(ByteArrayOutputStream bos)
throws IOException
IOException
public void expectTag(int expectTag)
throws IOException
IOException
protected int parseTag()
throws IOException
IOException
protected int skipWhitespace()
throws IOException
IOException
protected boolean isWhitespace(int ch)
throws IOException
IOExceptionpublic Reader getReader()
AbstractHessianInputs b16 b8 non-final string chunk S b16 b8 final string chunk
getReader in class AbstractHessianInputpublic InputStream readInputStream()
AbstractHessianInputb b16 b8 non-final binary chunk B b16 b8 final binary chunk
readInputStream in class AbstractHessianInputpublic InputStream getInputStream()
protected IOException expectBeginTag(String expect,
String tag)
protected IOException expectedChar(String expect,
int ch)
protected IOException expectedTag(String expect,
int tag)
protected IOException error(String message)
protected static String tagName(int tag)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||