org.idoox.transport
Class RawOutputMessage

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.idoox.transport.OutputMessage
          extended byorg.idoox.transport.RawOutputMessage
All Implemented Interfaces:
Message
Direct Known Subclasses:
OutputMessageWrapper

public abstract class RawOutputMessage
extends OutputMessage

Raw output message. This class is useful for transport implementation which needs wrap another output stream.

Component:
Core

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
RawOutputMessage(java.io.OutputStream stream)
          Creates new raw output message.
 
Method Summary
 void close()
          Closes the wrapped stream.
 void flush()
          Flushes the wrapped stream.
 java.io.OutputStream getWrappedStream()
          Gets a wrapped output stream.
protected  void initStream()
          This method is called before the first operation with the stream is called.
 void setWrappedStream(java.io.OutputStream stream)
          Sets new wrapped output stream.
 void write(byte[] b)
          Writes to the wrapped stream.
 void write(byte[] b, int off, int len)
          Writes to the wrapped stream.
 void write(int b)
          Writes to the wrapped stream.
 
Methods inherited from class org.idoox.transport.OutputMessage
nextPart, setContentType, setCorrupted, setDateHeader, setIntHeader, setMultipartType, setStatusCode, setStringHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isInited

protected boolean isInited
If this stream is initialized.

Constructor Detail

RawOutputMessage

public RawOutputMessage(java.io.OutputStream stream)
Creates new raw output message.

Parameters:
stream - the stream which is wrapped
Method Detail

setWrappedStream

public void setWrappedStream(java.io.OutputStream stream)
Sets new wrapped output stream.

Parameters:
stream - wrapped stream

getWrappedStream

public java.io.OutputStream getWrappedStream()
Gets a wrapped output stream.

Returns:
wrapped stream

write

public void write(int b)
           throws java.io.IOException
Writes to the wrapped stream.

Parameters:
b - the byte
Throws:
java.io.IOException - if an I/O error occurs

write

public void write(byte[] b)
           throws java.io.IOException
Writes to the wrapped stream.

Parameters:
b - the data
Throws:
java.io.IOException - if an I/O error occurs

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Writes to the wrapped stream.

Parameters:
b - the data
off - the start offset in the data
len - the number of bytes to write
Throws:
java.io.IOException - if an I/O error occurs

flush

public void flush()
           throws java.io.IOException
Flushes the wrapped stream.

Throws:
java.io.IOException - if an I/O error occurs

close

public void close()
           throws java.io.IOException
Closes the wrapped stream.

Throws:
java.io.IOException - if an I/O error occurs

initStream

protected void initStream()
                   throws java.io.IOException
This method is called before the first operation with the stream is called.

Throws:
java.io.IOException