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 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 and Description |
|---|
BurlapInput()
Creates an uninitialized Burlap input stream.
|
BurlapInput(InputStream is)
Creates a new Burlap input stream, initialized with an
underlying input stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addRef(Object ref)
Adds a list/map reference.
|
void |
completeCall()
Completes reading the call
|
void |
completeReply()
Completes reading the call
|
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
|
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
|
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 |
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.
|
String |
readMethod()
Reads the method
|
Node |
readNode()
Reads an XML node.
|
void |
readNull()
Reads a 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
|
String |
readString()
Reads a 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
|
void |
startReply()
Starts reading the reply
|
protected static 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 ArrayList _refs
protected int _peek
protected StringBuffer _sbuf
protected StringBuffer _entityBuffer
protected Calendar _utcCalendar
protected Calendar _localCalendar
public BurlapInput()
public BurlapInput(InputStream is)
is - the underlying input stream.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 AbstractHessianInputIOExceptionpublic int readCall()
throws IOException
A successful completion will have a single value:
<burlap:call>
readCall in class AbstractHessianInputIOExceptionpublic String readMethod() throws IOException
<method>method</method>
readMethod in class AbstractHessianInputIOExceptionpublic void completeCall()
throws IOException
A successful completion will have a single value:
</burlap:call>
completeCall in class AbstractHessianInputIOExceptionpublic Object readReply(Class expectedClass) throws Throwable
readReply in class AbstractHessianInputThrowablepublic void startReply()
throws Throwable
A successful completion will have a single value:
<burlap:reply> <value>
startReply in class AbstractHessianInputThrowablepublic void completeReply()
throws IOException
A successful completion will have a single value:
</burlap:reply>
completeReply in class AbstractHessianInputIOExceptionpublic String readHeader() throws IOException
<header>value</header>
readHeader in class AbstractHessianInputIOExceptionpublic void readNull()
throws IOException
<null></null>
readNull in class AbstractHessianInputIOExceptionpublic boolean readBoolean()
throws IOException
<boolean>0</boolean> <boolean>1</boolean>
readBoolean in class AbstractHessianInputIOExceptionpublic byte readByte()
throws IOException
<int>value</int>
IOExceptionpublic short readShort()
throws IOException
<int>value</int>
IOExceptionpublic int readInt()
throws IOException
<int>value</int>
readInt in class AbstractHessianInputIOExceptionpublic long readLong()
throws IOException
<long>value</long>
readLong in class AbstractHessianInputIOExceptionpublic float readFloat()
throws IOException
<double>value</double>
IOExceptionpublic double readDouble()
throws IOException
<double>value</double>
readDouble in class AbstractHessianInputIOExceptionpublic long readUTCDate()
throws IOException
<date>ISO-8609 date</date>
readUTCDate in class AbstractHessianInputIOExceptionpublic long readLocalDate()
throws IOException
<date>ISO-8609 date</date>
IOExceptionpublic String readString() throws IOException
<string>value</string>
readString in class AbstractHessianInputIOExceptionpublic Node readNode() throws IOException
&xml;xml string</xml>
readNode in class AbstractHessianInputIOExceptionpublic byte[] readBytes()
throws IOException
<base64>...</base64>
readBytes in class AbstractHessianInputIOExceptionpublic int readLength()
throws IOException
<length>value</length>
readLength in class AbstractHessianInputIOExceptionpublic Object readObject(Class cl) throws IOException
readObject in class AbstractHessianInputcl - the expected class if the protocol doesn't supply it.IOExceptionpublic Object readObject() throws IOException
readObject in class AbstractHessianInputIOExceptionpublic Object readRemote() throws IOException
readRemote in class AbstractHessianInputIOExceptionpublic Object readRef() throws IOException
readRef in class AbstractHessianInputIOExceptionpublic int readListStart()
throws IOException
readListStart in class AbstractHessianInputIOExceptionpublic int readMapStart()
throws IOException
readMapStart in class AbstractHessianInputIOExceptionpublic boolean isEnd()
throws IOException
isEnd in class AbstractHessianInputIOExceptionpublic void readEnd()
throws IOException
readEnd in class AbstractHessianInputIOExceptionpublic void readMapEnd()
throws IOException
readMapEnd in class AbstractHessianInputIOExceptionpublic void readListEnd()
throws IOException
readListEnd in class AbstractHessianInputIOExceptionpublic int addRef(Object ref)
addRef in class AbstractHessianInputpublic void setRef(int i,
Object ref)
setRef in class AbstractHessianInputpublic Object resolveRemote(String type, String url) throws IOException
IOExceptionpublic String readType() throws IOException
<type>type</type>
readType in class AbstractHessianInputIOExceptionprotected long parseDate()
throws IOException
IOExceptionprotected long parseDate(Calendar calendar) throws IOException
IOExceptionprotected String parseString() throws IOException
IOExceptionprotected StringBuffer parseString(StringBuffer sbuf) throws IOException
IOExceptionprotected byte[] parseBytes()
throws IOException
IOExceptionprotected ByteArrayOutputStream parseBytes(ByteArrayOutputStream bos) throws IOException
IOExceptionpublic void expectTag(int expectTag)
throws IOException
IOExceptionprotected int parseTag()
throws IOException
IOExceptionprotected int skipWhitespace()
throws IOException
IOExceptionprotected 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)
Copyright © 2017 Caucho Technology, Inc. All rights reserved.