Package com.caucho.burlap.io
Class BurlapInput
java.lang.Object
com.caucho.hessian.io.AbstractHessianInput
com.caucho.burlap.io.AbstractBurlapInput
com.caucho.burlap.io.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
FieldsModifier and TypeFieldDescriptionprotected StringBufferprotected Calendarprotected intprotected ArrayListprotected StringBufferprotected SerializerFactoryprotected Calendarstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionCreates an uninitialized Burlap input stream.Creates a new Burlap input stream, initialized with an underlying input stream. -
Method Summary
Modifier and TypeMethodDescriptionintAdds a list/map reference.voidCompletes reading the callvoidCompletes reading the callprotected IOExceptionprotected IOExceptionexpectBeginTag(String expect, String tag) protected IOExceptionexpectedChar(String expect, int ch) protected IOExceptionexpectedTag(String expect, int tag) voidexpectTag(int expectTag) Returns the calls methodStarts reading a string.Returns any reply fault.Gets the serializer factory.voidinit(InputStream is) Initialize the burlap stream with the underlying input stream.booleanisEnd()Returns true if this is the end of a list or a map.protected booleanisWhitespace(int ch) protected byte[]Parses a byte array.protected ByteArrayOutputStreamParses a byte array.protected longParses a date value from the stream.protected longParses a date value from the stream.protected Stringprotected StringBufferparseString(StringBuffer sbuf) Parses a string value from the stream.protected intparseTag()Parses a tag.booleanReads a booleanbytereadByte()Reads a bytebyte[]Reads a byte arrayintreadCall()Starts reading the calldoubleReads a doublevoidreadEnd()Reads the end byte.floatReads a floatReads a header, returning null if there are no headers.Starts reading a byte array using an input stream.intreadInt()Reads an integerintReads a lengthvoidReads the end of the mapintReads the start of a list.longReads a date.longreadLong()Reads a longvoidReads the end of the mapintReads the start of a map.Reads the methodreadNode()Reads an XML node.voidreadNull()Reads a nullReads an arbitrary object from the input stream when the type is unknown.readObject(Class cl) Reads an object from the input stream with an expected type.readRef()Reads a reference.Reads a remote object.Reads a reply as an object.shortReads a shortReads a stringreadType()Parses a type from the stream.longReads a date.resolveRemote(String type, String url) Resolves a remote object.voidAdds a list/map reference.voidsetSerializerFactory(SerializerFactory factory) Sets the serializer factory.protected intvoidStarts reading the callvoidStarts reading the replyprotected static StringtagName(int tag) Methods inherited from class com.caucho.hessian.io.AbstractHessianInput
close, getRemoteResolver, readMethodArgLength, readToOutputStream, resetReferences, setRemoteResolver, skipOptionalCall, startReplyBody
-
Field Details
-
TAG_EOF
public static final int TAG_EOF- See Also:
-
TAG_NULL
public static final int TAG_NULL- See Also:
-
TAG_BOOLEAN
public static final int TAG_BOOLEAN- See Also:
-
TAG_INT
public static final int TAG_INT- See Also:
-
TAG_LONG
public static final int TAG_LONG- See Also:
-
TAG_DOUBLE
public static final int TAG_DOUBLE- See Also:
-
TAG_DATE
public static final int TAG_DATE- See Also:
-
TAG_STRING
public static final int TAG_STRING- See Also:
-
TAG_XML
public static final int TAG_XML- See Also:
-
TAG_BASE64
public static final int TAG_BASE64- See Also:
-
TAG_MAP
public static final int TAG_MAP- See Also:
-
TAG_LIST
public static final int TAG_LIST- See Also:
-
TAG_TYPE
public static final int TAG_TYPE- See Also:
-
TAG_LENGTH
public static final int TAG_LENGTH- See Also:
-
TAG_REF
public static final int TAG_REF- See Also:
-
TAG_REMOTE
public static final int TAG_REMOTE- See Also:
-
TAG_CALL
public static final int TAG_CALL- See Also:
-
TAG_REPLY
public static final int TAG_REPLY- See Also:
-
TAG_FAULT
public static final int TAG_FAULT- See Also:
-
TAG_METHOD
public static final int TAG_METHOD- See Also:
-
TAG_HEADER
public static final int TAG_HEADER- See Also:
-
TAG_NULL_END
public static final int TAG_NULL_END- See Also:
-
TAG_BOOLEAN_END
public static final int TAG_BOOLEAN_END- See Also:
-
TAG_INT_END
public static final int TAG_INT_END- See Also:
-
TAG_LONG_END
public static final int TAG_LONG_END- See Also:
-
TAG_DOUBLE_END
public static final int TAG_DOUBLE_END- See Also:
-
TAG_DATE_END
public static final int TAG_DATE_END- See Also:
-
TAG_STRING_END
public static final int TAG_STRING_END- See Also:
-
TAG_XML_END
public static final int TAG_XML_END- See Also:
-
TAG_BASE64_END
public static final int TAG_BASE64_END- See Also:
-
TAG_MAP_END
public static final int TAG_MAP_END- See Also:
-
TAG_LIST_END
public static final int TAG_LIST_END- See Also:
-
TAG_TYPE_END
public static final int TAG_TYPE_END- See Also:
-
TAG_LENGTH_END
public static final int TAG_LENGTH_END- See Also:
-
TAG_REF_END
public static final int TAG_REF_END- See Also:
-
TAG_REMOTE_END
public static final int TAG_REMOTE_END- See Also:
-
TAG_CALL_END
public static final int TAG_CALL_END- See Also:
-
TAG_REPLY_END
public static final int TAG_REPLY_END- See Also:
-
TAG_FAULT_END
public static final int TAG_FAULT_END- See Also:
-
TAG_METHOD_END
public static final int TAG_METHOD_END- See Also:
-
TAG_HEADER_END
public static final int TAG_HEADER_END- See Also:
-
_serializerFactory
-
_refs
-
_peek
protected int _peek -
_sbuf
-
_entityBuffer
-
_utcCalendar
-
_localCalendar
-
-
Constructor Details
-
BurlapInput
public BurlapInput()Creates an uninitialized Burlap input stream. -
BurlapInput
Creates a new Burlap input stream, initialized with an underlying input stream.- Parameters:
is- the underlying input stream.
-
-
Method Details
-
setSerializerFactory
Sets the serializer factory.- Overrides:
setSerializerFactoryin classAbstractHessianInput
-
getSerializerFactory
Gets the serializer factory. -
init
Initialize the burlap stream with the underlying input stream.- Overrides:
initin classAbstractHessianInput
-
getMethod
Returns the calls method- Specified by:
getMethodin classAbstractHessianInput
-
getReplyFault
Returns any reply fault. -
startCall
Starts reading the call<burlap:call> <method>method</method>
- Specified by:
startCallin classAbstractHessianInput- Throws:
IOException
-
readCall
Starts reading the callA successful completion will have a single value:
<burlap:call>
- Specified by:
readCallin classAbstractHessianInput- Throws:
IOException
-
readMethod
Reads the method<method>method</method>
- Specified by:
readMethodin classAbstractHessianInput- Throws:
IOException
-
completeCall
Completes reading the callA successful completion will have a single value:
</burlap:call>
- Specified by:
completeCallin classAbstractHessianInput- Throws:
IOException
-
readReply
Reads a reply as an object. If the reply has a fault, throws the exception.- Specified by:
readReplyin classAbstractHessianInput- Throws:
Throwable
-
startReply
Starts reading the replyA successful completion will have a single value:
<burlap:reply> <value>
- Specified by:
startReplyin classAbstractHessianInput- Throws:
Throwable
-
completeReply
Completes reading the callA successful completion will have a single value:
</burlap:reply>
- Specified by:
completeReplyin classAbstractHessianInput- Throws:
IOException
-
readHeader
Reads a header, returning null if there are no headers.<header>value</header>
- Specified by:
readHeaderin classAbstractHessianInput- Throws:
IOException
-
readNull
Reads a null<null></null>
- Specified by:
readNullin classAbstractHessianInput- Throws:
IOException
-
readBoolean
Reads a boolean<boolean>0</boolean> <boolean>1</boolean>
- Specified by:
readBooleanin classAbstractHessianInput- Throws:
IOException
-
readByte
Reads a byte<int>value</int>
- Throws:
IOException
-
readShort
Reads a short<int>value</int>
- Throws:
IOException
-
readInt
Reads an integer<int>value</int>
- Specified by:
readIntin classAbstractHessianInput- Throws:
IOException
-
readLong
Reads a long<long>value</long>
- Specified by:
readLongin classAbstractHessianInput- Throws:
IOException
-
readFloat
Reads a float<double>value</double>
- Throws:
IOException
-
readDouble
Reads a double<double>value</double>
- Specified by:
readDoublein classAbstractHessianInput- Throws:
IOException
-
readUTCDate
Reads a date.<date>ISO-8609 date</date>
- Specified by:
readUTCDatein classAbstractHessianInput- Throws:
IOException
-
readLocalDate
Reads a date.<date>ISO-8609 date</date>
- Throws:
IOException
-
readString
Reads a string<string>value</string>
- Specified by:
readStringin classAbstractHessianInput- Throws:
IOException
-
readNode
Reads an XML node.&xml;xml string</xml>
- Overrides:
readNodein classAbstractHessianInput- Throws:
IOException
-
readBytes
Reads a byte array<base64>...</base64>
- Specified by:
readBytesin classAbstractHessianInput- Throws:
IOException
-
readLength
Reads a length<length>value</length>
- Specified by:
readLengthin classAbstractHessianInput- Throws:
IOException
-
readObject
Reads an object from the input stream with an expected type.- Specified by:
readObjectin classAbstractHessianInput- Parameters:
cl- the expected class if the protocol doesn't supply it.- Throws:
IOException
-
readObject
Reads an arbitrary object from the input stream when the type is unknown.- Specified by:
readObjectin classAbstractHessianInput- Throws:
IOException
-
readRemote
Reads a remote object.- Specified by:
readRemotein classAbstractHessianInput- Throws:
IOException
-
readRef
Reads a reference.- Specified by:
readRefin classAbstractHessianInput- Throws:
IOException
-
readListStart
Reads the start of a list.- Specified by:
readListStartin classAbstractHessianInput- Throws:
IOException
-
readMapStart
Reads the start of a map.- Specified by:
readMapStartin classAbstractHessianInput- Throws:
IOException
-
isEnd
Returns true if this is the end of a list or a map.- Specified by:
isEndin classAbstractHessianInput- Throws:
IOException
-
readEnd
Reads the end byte.- Specified by:
readEndin classAbstractHessianInput- Throws:
IOException
-
readMapEnd
Reads the end of the map- Specified by:
readMapEndin classAbstractHessianInput- Throws:
IOException
-
readListEnd
Reads the end of the map- Specified by:
readListEndin classAbstractHessianInput- Throws:
IOException
-
addRef
Adds a list/map reference.- Specified by:
addRefin classAbstractHessianInput
-
setRef
Adds a list/map reference.- Specified by:
setRefin classAbstractHessianInput
-
resolveRemote
Resolves a remote object.- Throws:
IOException
-
readType
Parses a type from the stream.<type>type</type>
- Specified by:
readTypein classAbstractHessianInput- Throws:
IOException
-
parseDate
Parses a date value from the stream.- Throws:
IOException
-
parseDate
Parses a date value from the stream.- Throws:
IOException
-
parseString
- Throws:
IOException
-
parseString
Parses a string value from the stream. The burlap object's string buffer is used for the result.- Throws:
IOException
-
parseBytes
Parses a byte array.- Throws:
IOException
-
parseBytes
Parses a byte array.- Throws:
IOException
-
expectTag
- Throws:
IOException
-
parseTag
Parses a tag. Returns true if it's a start tag.- Throws:
IOException
-
skipWhitespace
- Throws:
IOException
-
isWhitespace
- Throws:
IOException
-
getReader
Description copied from class:AbstractHessianInputStarts reading a string. All the characters must be read before calling the next method. The actual characters will be read with the reader's read() or read(char [], int, int).s b16 b8 non-final string chunk S b16 b8 final string chunk
- Specified by:
getReaderin classAbstractHessianInput
-
readInputStream
Description copied from class:AbstractHessianInputStarts reading a byte array using an input stream. All the bytes must be read before calling the following method.b b16 b8 non-final binary chunk B b16 b8 final binary chunk
- Specified by:
readInputStreamin classAbstractHessianInput
-
getInputStream
-
expectBeginTag
-
expectedChar
-
expectedTag
-
error
-
tagName
-