public class BurlapInput extends AbstractBurlapInput
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
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.StringBuffer |
_entityBuffer |
protected java.util.Calendar |
_localCalendar |
protected int |
_peek |
protected java.util.ArrayList |
_refs |
protected java.lang.StringBuffer |
_sbuf |
protected SerializerFactory |
_serializerFactory |
protected java.util.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 and Description |
|---|
BurlapInput()
Creates an uninitialized Burlap input stream.
|
BurlapInput(java.io.InputStream is)
Creates a new Burlap input stream, initialized with an
underlying input stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addRef(java.lang.Object ref)
Adds a list/map reference.
|
void |
completeCall()
Completes reading the call
|
void |
completeReply()
Completes reading the call
|
protected java.io.IOException |
error(java.lang.String message) |
protected java.io.IOException |
expectBeginTag(java.lang.String expect,
java.lang.String tag) |
protected java.io.IOException |
expectedChar(java.lang.String expect,
int ch) |
protected java.io.IOException |
expectedTag(java.lang.String expect,
int tag) |
void |
expectTag(int expectTag) |
java.io.InputStream |
getInputStream() |
java.lang.String |
getMethod()
Returns the calls method
|
java.io.Reader |
getReader()
Starts reading a string.
|
java.lang.Throwable |
getReplyFault()
Returns any reply fault.
|
SerializerFactory |
getSerializerFactory()
Gets the serializer factory.
|
void |
init(java.io.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 java.io.ByteArrayOutputStream |
parseBytes(java.io.ByteArrayOutputStream bos)
Parses a byte array.
|
protected long |
parseDate()
Parses a date value from the stream.
|
protected long |
parseDate(java.util.Calendar calendar)
Parses a date value from the stream.
|
protected java.lang.String |
parseString() |
protected java.lang.StringBuffer |
parseString(java.lang.StringBuffer sbuf)
Parses a string value from the stream.
|
protected int |
parseTag()
Parses a tag.
|
boolean |
readBoolean()
Reads a boolean
|
byte |
readByte()
Reads a byte
|
byte[] |
readBytes()
Reads a byte array
|
int |
readCall()
Starts reading the call
|
double |
readDouble()
Reads a double
|
void |
readEnd()
Reads the end byte.
|
float |
readFloat()
Reads a float
|
java.lang.String |
readHeader()
Reads a header, returning null if there are no headers.
|
java.io.InputStream |
readInputStream()
Starts reading a byte array using an input stream.
|
int |
readInt()
Reads an integer
|
int |
readLength()
Reads a 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
|
void |
readMapEnd()
Reads the end of the map
|
int |
readMapStart()
Reads the start of a map.
|
java.lang.String |
readMethod()
Reads the method
|
org.w3c.dom.Node |
readNode()
Reads an XML node.
|
void |
readNull()
Reads a null
|
java.lang.Object |
readObject()
Reads an arbitrary object from the input stream when the type
is unknown.
|
java.lang.Object |
readObject(java.lang.Class cl)
Reads an object from the input stream with an expected type.
|
java.lang.Object |
readRef()
Reads a reference.
|
java.lang.Object |
readRemote()
Reads a remote object.
|
java.lang.Object |
readReply(java.lang.Class expectedClass)
Reads a reply as an object.
|
short |
readShort()
Reads a short
|
java.lang.String |
readString()
Reads a string
|
java.lang.String |
readType()
Parses a type from the stream.
|
long |
readUTCDate()
Reads a date.
|
java.lang.Object |
resolveRemote(java.lang.String type,
java.lang.String url)
Resolves a remote object.
|
void |
setRef(int i,
java.lang.Object ref)
Adds a list/map reference.
|
void |
setSerializerFactory(SerializerFactory factory)
Sets the serializer factory.
|
protected int |
skipWhitespace() |
void |
startCall()
Starts reading the call
|
void |
startReply()
Starts reading the reply
|
protected static java.lang.String |
tagName(int tag) |
close, getRemoteResolver, readMethodArgLength, readToOutputStream, resetReferences, setRemoteResolver, skipOptionalCall, startReplyBodypublic 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 java.util.ArrayList _refs
protected int _peek
protected java.lang.StringBuffer _sbuf
protected java.lang.StringBuffer _entityBuffer
protected java.util.Calendar _utcCalendar
protected java.util.Calendar _localCalendar
public BurlapInput()
public BurlapInput(java.io.InputStream is)
is - the underlying input stream.public void setSerializerFactory(SerializerFactory factory)
setSerializerFactory in class AbstractHessianInputpublic SerializerFactory getSerializerFactory()
public void init(java.io.InputStream is)
init in class AbstractHessianInputpublic java.lang.String getMethod()
getMethod in class AbstractHessianInputpublic java.lang.Throwable getReplyFault()
public void startCall()
throws java.io.IOException
<burlap:call> <method>method</method>
startCall in class AbstractHessianInputjava.io.IOExceptionpublic int readCall()
throws java.io.IOException
A successful completion will have a single value:
<burlap:call>
readCall in class AbstractHessianInputjava.io.IOExceptionpublic java.lang.String readMethod()
throws java.io.IOException
<method>method</method>
readMethod in class AbstractHessianInputjava.io.IOExceptionpublic void completeCall()
throws java.io.IOException
A successful completion will have a single value:
</burlap:call>
completeCall in class AbstractHessianInputjava.io.IOExceptionpublic java.lang.Object readReply(java.lang.Class expectedClass)
throws java.lang.Throwable
readReply in class AbstractHessianInputjava.lang.Throwablepublic void startReply()
throws java.lang.Throwable
A successful completion will have a single value:
<burlap:reply> <value>
startReply in class AbstractHessianInputjava.lang.Throwablepublic void completeReply()
throws java.io.IOException
A successful completion will have a single value:
</burlap:reply>
completeReply in class AbstractHessianInputjava.io.IOExceptionpublic java.lang.String readHeader()
throws java.io.IOException
<header>value</header>
readHeader in class AbstractHessianInputjava.io.IOExceptionpublic void readNull()
throws java.io.IOException
<null></null>
readNull in class AbstractHessianInputjava.io.IOExceptionpublic boolean readBoolean()
throws java.io.IOException
<boolean>0</boolean> <boolean>1</boolean>
readBoolean in class AbstractHessianInputjava.io.IOExceptionpublic byte readByte()
throws java.io.IOException
<int>value</int>
java.io.IOExceptionpublic short readShort()
throws java.io.IOException
<int>value</int>
java.io.IOExceptionpublic int readInt()
throws java.io.IOException
<int>value</int>
readInt in class AbstractHessianInputjava.io.IOExceptionpublic long readLong()
throws java.io.IOException
<long>value</long>
readLong in class AbstractHessianInputjava.io.IOExceptionpublic float readFloat()
throws java.io.IOException
<double>value</double>
java.io.IOExceptionpublic double readDouble()
throws java.io.IOException
<double>value</double>
readDouble in class AbstractHessianInputjava.io.IOExceptionpublic long readUTCDate()
throws java.io.IOException
<date>ISO-8609 date</date>
readUTCDate in class AbstractHessianInputjava.io.IOExceptionpublic long readLocalDate()
throws java.io.IOException
<date>ISO-8609 date</date>
java.io.IOExceptionpublic java.lang.String readString()
throws java.io.IOException
<string>value</string>
readString in class AbstractHessianInputjava.io.IOExceptionpublic org.w3c.dom.Node readNode()
throws java.io.IOException
&xml;xml string</xml>
readNode in class AbstractHessianInputjava.io.IOExceptionpublic byte[] readBytes()
throws java.io.IOException
<base64>...</base64>
readBytes in class AbstractHessianInputjava.io.IOExceptionpublic int readLength()
throws java.io.IOException
<length>value</length>
readLength in class AbstractHessianInputjava.io.IOExceptionpublic java.lang.Object readObject(java.lang.Class cl)
throws java.io.IOException
readObject in class AbstractHessianInputcl - the expected class if the protocol doesn't supply it.java.io.IOExceptionpublic java.lang.Object readObject()
throws java.io.IOException
readObject in class AbstractHessianInputjava.io.IOExceptionpublic java.lang.Object readRemote()
throws java.io.IOException
readRemote in class AbstractHessianInputjava.io.IOExceptionpublic java.lang.Object readRef()
throws java.io.IOException
readRef in class AbstractHessianInputjava.io.IOExceptionpublic int readListStart()
throws java.io.IOException
readListStart in class AbstractHessianInputjava.io.IOExceptionpublic int readMapStart()
throws java.io.IOException
readMapStart in class AbstractHessianInputjava.io.IOExceptionpublic boolean isEnd()
throws java.io.IOException
isEnd in class AbstractHessianInputjava.io.IOExceptionpublic void readEnd()
throws java.io.IOException
readEnd in class AbstractHessianInputjava.io.IOExceptionpublic void readMapEnd()
throws java.io.IOException
readMapEnd in class AbstractHessianInputjava.io.IOExceptionpublic void readListEnd()
throws java.io.IOException
readListEnd in class AbstractHessianInputjava.io.IOExceptionpublic int addRef(java.lang.Object ref)
addRef in class AbstractHessianInputpublic void setRef(int i,
java.lang.Object ref)
setRef in class AbstractHessianInputpublic java.lang.Object resolveRemote(java.lang.String type,
java.lang.String url)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String readType()
throws java.io.IOException
<type>type</type>
readType in class AbstractHessianInputjava.io.IOExceptionprotected long parseDate()
throws java.io.IOException
java.io.IOExceptionprotected long parseDate(java.util.Calendar calendar)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String parseString()
throws java.io.IOException
java.io.IOExceptionprotected java.lang.StringBuffer parseString(java.lang.StringBuffer sbuf)
throws java.io.IOException
java.io.IOExceptionprotected byte[] parseBytes()
throws java.io.IOException
java.io.IOExceptionprotected java.io.ByteArrayOutputStream parseBytes(java.io.ByteArrayOutputStream bos)
throws java.io.IOException
java.io.IOExceptionpublic void expectTag(int expectTag)
throws java.io.IOException
java.io.IOExceptionprotected int parseTag()
throws java.io.IOException
java.io.IOExceptionprotected int skipWhitespace()
throws java.io.IOException
java.io.IOExceptionprotected boolean isWhitespace(int ch)
throws java.io.IOException
java.io.IOExceptionpublic java.io.Reader getReader()
AbstractHessianInputs b16 b8 non-final string chunk S b16 b8 final string chunk
getReader in class AbstractHessianInputpublic java.io.InputStream readInputStream()
AbstractHessianInputb b16 b8 non-final binary chunk B b16 b8 final binary chunk
readInputStream in class AbstractHessianInputpublic java.io.InputStream getInputStream()
protected java.io.IOException expectBeginTag(java.lang.String expect,
java.lang.String tag)
protected java.io.IOException expectedChar(java.lang.String expect,
int ch)
protected java.io.IOException expectedTag(java.lang.String expect,
int tag)
protected java.io.IOException error(java.lang.String message)
protected static java.lang.String tagName(int tag)