|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
org.idoox.transport.InputMessage
org.idoox.transport.RawInputMessage
Raw input message. This class is useful for transport implementation which needs wrap another input stream.
Field Summary | |
protected boolean |
isInited
If this stream is initialized. |
Fields inherited from interface org.idoox.transport.Message |
CT_APPLICATION_DIME, CT_MULTIPART_ALTERNATIVE, CT_MULTIPART_MIXED, CT_MULTIPART_RELATED, CT_MUTLIPART_FORMDATA, SC_ACCEPTED, SC_BAD_MESSAGE, SC_CREATED, SC_FORBIDDEN, SC_INTERNAL_ERROR, SC_METHOD_NOT_ALLOWED, SC_NO_CONTENT, SC_NOT_FOUND, SC_OK, SC_PROTOCOL_NOT_SUPPORTED, SC_REQUEST_TIMEOUT, SC_SERVICE_UNAVAILABLE, SC_SOAP_ACTION_REQUIRED, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE |
Constructor Summary | |
RawInputMessage(java.io.InputStream stream)
Creates new raw input message. |
Method Summary | |
int |
available()
Gets available bytes from the wrapped stream. |
void |
close()
Closes the wrapped stream. |
java.io.InputStream |
getWrappedStream()
Gets a wrapped input stream. |
protected void |
initStream()
This method is called before the first operation with the stream is called. |
void |
mark(int readlimit)
Marks the wrapped stream. |
boolean |
markSupported()
Gets if there is mark supported in the wrapped stream. |
int |
read()
Reads from the wrapped stream. |
int |
read(byte[] b)
Reads from the wrapped stream. |
int |
read(byte[] b,
int off,
int len)
Reads from the wrapped stream. |
void |
reset()
Resets the wrapped stream. |
void |
setWrappedStream(java.io.InputStream stream)
Sets new wrapped input stream. |
long |
skip(long n)
Skips in the wrapped stream. |
Methods inherited from class org.idoox.transport.InputMessage |
getContentType, getDateHeader, getHeaderNames, getIntHeader, getMultipartType, getStatusCode, getStringHeader, nextPart |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean isInited
Constructor Detail |
public RawInputMessage(java.io.InputStream stream)
stream
- the stream which is wrappedMethod Detail |
public void setWrappedStream(java.io.InputStream stream)
stream
- wrapped streampublic java.io.InputStream getWrappedStream()
public int read() throws java.io.IOException
-1
if the end of the
stream is reached
java.io.IOException
- if an I/O error occurspublic int read(byte[] b) throws java.io.IOException
b
- the buffer into which the data is read
-1
is there is no more data because the end of
the stream has been reached
java.io.IOException
- if an I/O error occurspublic int read(byte[] b, int off, int len) throws java.io.IOException
b
- the buffer into which the data is readoff
- the start offset in array b
at which the data is writtenlen
- the maximum number of bytes to read
-1
if there is no more data because the end of
the stream has been reached
java.io.IOException
- if an I/O error occurspublic long skip(long n) throws java.io.IOException
n
- the number of bytes to be skipped
java.io.IOException
- if an I/O error occurspublic int available() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic void close() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic void mark(int readlimit)
readlimit
- the maximum limit of bytes that can be read before
the mark position becomes invalidpublic void reset() throws java.io.IOException
java.io.IOException
- if this stream has not been marked or if the
mark has been invalidatedpublic boolean markSupported()
true
if this true type supports the mark and reset
method; false
otherwiseprotected void initStream() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |