de.uplanet.lucy.server.connector.web
Class OutgoingWireProtocolOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by de.uplanet.lucy.server.connector.web.OutgoingWireProtocolOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public final class OutgoingWireProtocolOutputStream
extends java.io.OutputStream

Version:
$Revision: 49132 $

Field Summary
static java.lang.String SYSPROP_HTTP_HEADER_ENCODING
           
 
Constructor Summary
OutgoingWireProtocolOutputStream(java.io.OutputStream p_out)
           
OutgoingWireProtocolOutputStream(java.io.OutputStream p_out, int p_iBufSize)
           
 
Method Summary
 void close()
           
 void flush()
           
 void flushHttpHeaders()
          Flush delayed headers to the output stream.
 int getBytesReceived()
          Get the number of bytes that were handed over to this stream.
 boolean isStreaming()
           
 void reset()
           
 void setStreaming()
          Switch the wire protocol stream to streaming mode.
 void write(byte[] p_b)
           
 void write(byte[] p_b, int p_off, int p_len)
           
 void write(int p_b)
           
 void writeHttpHeader(java.lang.String p_strName, java.lang.String p_strValue)
           
 void writeHttpStatus(int p_iStatus, java.lang.String p_strStatus)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSPROP_HTTP_HEADER_ENCODING

public static final java.lang.String SYSPROP_HTTP_HEADER_ENCODING
See Also:
Constant Field Values
Constructor Detail

OutgoingWireProtocolOutputStream

public OutgoingWireProtocolOutputStream(java.io.OutputStream p_out)
Parameters:
p_out - The underlying output stream.

OutgoingWireProtocolOutputStream

public OutgoingWireProtocolOutputStream(java.io.OutputStream p_out,
                                        int p_iBufSize)
Parameters:
p_out - The underlying output stream.
p_iBufSize - The buffer size to be used.
Method Detail

isStreaming

public boolean isStreaming()
Returns:
true if the wire protocol stream is in streaming mode, false otherwise.

setStreaming

public void setStreaming()
                  throws java.io.IOException
Switch the wire protocol stream to streaming mode.

Throws:
java.io.IOException

getBytesReceived

public int getBytesReceived()
Get the number of bytes that were handed over to this stream.

Returns:
The number of bytes.

writeHttpStatus

public void writeHttpStatus(int p_iStatus,
                            java.lang.String p_strStatus)
                     throws java.io.IOException
Parameters:
p_iStatus - The HTTP status code.
p_strStatus - A non-empty status message, or null.
Throws:
java.io.IOException

writeHttpHeader

public void writeHttpHeader(java.lang.String p_strName,
                            java.lang.String p_strValue)
                     throws java.io.IOException
Parameters:
p_strName -
p_strValue -
Throws:
java.io.IOException

flushHttpHeaders

public void flushHttpHeaders()
                      throws java.io.IOException
Flush delayed headers to the output stream.

This method has no effect in streaming mode.

Throws:
java.io.IOException

write

public void write(byte[] p_b,
                  int p_off,
                  int p_len)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] p_b)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(int p_b)
           throws java.io.IOException
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

reset

public void reset()
Throws:
java.lang.IllegalStateException - - If this stream is in streaming mode, or data were already committed.


Last updated: 2011-01-27
Copyright 2000-2010 United Planet. All Rights Reserved.