com.ibm.wsspi.http

Class HttpOutputStream

  1. java.lang.Object
  2. extended byjava.io.OutputStream
  3. extended bycom.ibm.wsspi.http.HttpOutputStream
All implemented interfaces:
java.io.Closeable, java.io.Flushable

  1. public class HttpOutputStream
  2. extends java.io.OutputStream
HTTP transport output stream that wraps the bytebuffer usage and the HTTP channel write logic with an outputstream interface.

Constructor Summary

Constructor and Description
HttpOutputStream(com.ibm.wsspi.http.channel.inbound.HttpInboundServiceContext context)
Constructor of an output stream for a given service context.

Method Summary

Modifier and Type Method and Description
  1. void
clear()
Clear any current buffer content in the stream.
  1. void
close()
  1. void
flush()
  1. void
flush(boolean ignoreFlag)
  1. void
flushBuffers()
Flush the output array of buffers to the network below.
  1. void
flushHeaders()
Write the current set of response headers.
  1. long
getBufferedCount()
Query the amount of bytes currently buffered so far.
  1. int
getBufferSize()
Query the amount of data this stream is configured to buffer before an automatic write happens.
  1. long
getBytesWritten()
Query the amount of bytes written so far.
  1. boolean
hasBufferedContent()
Test whether this stream has any current data buffered, waiting to be written out.
  1. boolean
isClosed()
Query whether this stream is closed already or not.
  1. void
setBufferSize(int size)
Set the amount of data to buffer internally before the stream itself initiates a flush.
  1. void
setContentLength(long length)
  1. void
setIsClosing(boolean b)
  1. void
setVirtualConnection(VirtualConnection inVC)
Set the reference to the virtual connection.
  1. java.lang.String
toString()
  1. void
write(byte[] value)
  1. void
write(byte[] value,int start,int len)
  1. void
write(int value)
  1. void
writeFile(java.nio.channels.FileChannel fc)
Write a file channel onto the output stream.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpOutputStream

  1. public HttpOutputStream(com.ibm.wsspi.http.channel.inbound.HttpInboundServiceContext context)
Constructor of an output stream for a given service context.
Parameters:
context -

Method Detail

setIsClosing

  1. public void setIsClosing(boolean b)

setVirtualConnection

  1. public void setVirtualConnection( VirtualConnection inVC)
Set the reference to the virtual connection.
Parameters:
inVC -

getBufferSize

  1. public int getBufferSize()
Query the amount of data this stream is configured to buffer before an automatic write happens.
Returns:
int

setBufferSize

  1. public void setBufferSize(int size)
Set the amount of data to buffer internally before the stream itself initiates a flush. A zero size means no buffer is done, each write call will flush data.
Parameters:
size -
Throws:
java.lang.IllegalStateException - if already writing data or closed

clear

  1. public void clear()
Clear any current buffer content in the stream.

getBytesWritten

  1. public long getBytesWritten()
Query the amount of bytes written so far.
Returns:
long

getBufferedCount

  1. public long getBufferedCount()
Query the amount of bytes currently buffered so far.
Returns:
long

hasBufferedContent

  1. public final boolean hasBufferedContent( )
Test whether this stream has any current data buffered, waiting to be written out.
Returns:
boolean

writeFile

  1. public void writeFile(java.nio.channels.FileChannel fc)
  2. throws java.io.IOException
Write a file channel onto the output stream.
Parameters:
fc -
Throws:
java.io.IOException

flushHeaders

  1. public void flushHeaders()
  2. throws java.io.IOException
Write the current set of response headers. If the headers have already been sent, this is a no-op.
Throws:
java.io.IOException

flushBuffers

  1. public void flushBuffers()
  2. throws java.io.IOException
Flush the output array of buffers to the network below.
Throws:
java.io.IOException

toString

  1. public java.lang.String toString( )
Overrides:
toString in class java.lang.Object

close

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

isClosed

  1. public final boolean isClosed()
Query whether this stream is closed already or not.
Returns:
boolean

flush

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

flush

  1. public void flush(boolean ignoreFlag)
  2. throws java.io.IOException
Throws:
java.io.IOException

setContentLength

  1. public void setContentLength(long length)

write

  1. public void write(byte[] value,
  2. int start,
  3. int len)
  4. throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

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

write

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