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, startReplyBody
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
public BurlapInput()
public BurlapInput(InputStream is)
is
- the underlying input stream.public void setSerializerFactory(SerializerFactory factory)
setSerializerFactory
in class AbstractHessianInput
public SerializerFactory getSerializerFactory()
public void init(InputStream is)
init
in class AbstractHessianInput
public String getMethod()
getMethod
in class AbstractHessianInput
public Throwable getReplyFault()
public void startCall() throws IOException
<burlap:call> <method>method</method>
startCall
in class AbstractHessianInput
IOException
public int readCall() throws IOException
A successful completion will have a single value:
<burlap:call>
readCall
in class AbstractHessianInput
IOException
public String readMethod() throws IOException
<method>method</method>
readMethod
in class AbstractHessianInput
IOException
public void completeCall() throws IOException
A successful completion will have a single value:
</burlap:call>
completeCall
in class AbstractHessianInput
IOException
public Object readReply(Class expectedClass) throws Throwable
readReply
in class AbstractHessianInput
Throwable
public void startReply() throws Throwable
A successful completion will have a single value:
<burlap:reply> <value>
startReply
in class AbstractHessianInput
Throwable
public void completeReply() throws IOException
A successful completion will have a single value:
</burlap:reply>
completeReply
in class AbstractHessianInput
IOException
public String readHeader() throws IOException
<header>value</header>
readHeader
in class AbstractHessianInput
IOException
public void readNull() throws IOException
<null></null>
readNull
in class AbstractHessianInput
IOException
public boolean readBoolean() throws IOException
<boolean>0</boolean> <boolean>1</boolean>
readBoolean
in class AbstractHessianInput
IOException
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 AbstractHessianInput
IOException
public long readLong() throws IOException
<long>value</long>
readLong
in class AbstractHessianInput
IOException
public float readFloat() throws IOException
<double>value</double>
IOException
public double readDouble() throws IOException
<double>value</double>
readDouble
in class AbstractHessianInput
IOException
public long readUTCDate() throws IOException
<date>ISO-8609 date</date>
readUTCDate
in class AbstractHessianInput
IOException
public long readLocalDate() throws IOException
<date>ISO-8609 date</date>
IOException
public String readString() throws IOException
<string>value</string>
readString
in class AbstractHessianInput
IOException
public Node readNode() throws IOException
&xml;xml string</xml>
readNode
in class AbstractHessianInput
IOException
public byte[] readBytes() throws IOException
<base64>...</base64>
readBytes
in class AbstractHessianInput
IOException
public int readLength() throws IOException
<length>value</length>
readLength
in class AbstractHessianInput
IOException
public Object readObject(Class cl) throws IOException
readObject
in class AbstractHessianInput
cl
- the expected class if the protocol doesn't supply it.IOException
public Object readObject() throws IOException
readObject
in class AbstractHessianInput
IOException
public Object readRemote() throws IOException
readRemote
in class AbstractHessianInput
IOException
public Object readRef() throws IOException
readRef
in class AbstractHessianInput
IOException
public int readListStart() throws IOException
readListStart
in class AbstractHessianInput
IOException
public int readMapStart() throws IOException
readMapStart
in class AbstractHessianInput
IOException
public boolean isEnd() throws IOException
isEnd
in class AbstractHessianInput
IOException
public void readEnd() throws IOException
readEnd
in class AbstractHessianInput
IOException
public void readMapEnd() throws IOException
readMapEnd
in class AbstractHessianInput
IOException
public void readListEnd() throws IOException
readListEnd
in class AbstractHessianInput
IOException
public 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 AbstractHessianInput
IOException
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
IOException
public Reader getReader()
AbstractHessianInput
s b16 b8 non-final string chunk S b16 b8 final string chunk
getReader
in class AbstractHessianInput
public InputStream readInputStream()
AbstractHessianInput
b b16 b8 non-final binary chunk B b16 b8 final binary chunk
readInputStream
in class AbstractHessianInput
public 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 © 2023. All rights reserved.