public class

PosterOutputStream

extends ByteArrayOutputStream
java.lang.Object
   ↳ java.io.OutputStream
     ↳ java.io.ByteArrayOutputStream
       ↳ sun.net.www.http.PosterOutputStream

Class Overview

Instances of this class are returned to applications for the purpose of sending user data for a HTTP POST or PUT request. This class is used when the content-length will be specified in the header of the request. The semantics of ByteArrayOutputStream are extended so that when close() is called, it is no longer possible to write additional data to the stream. From this point the content length of the request is fixed and cannot change.

Summary

[Expand]
Inherited Fields
From class java.io.ByteArrayOutputStream
Public Constructors
PosterOutputStream()
Creates a new output stream for POST user data
Public Methods
synchronized void close()
After close() has been called, it is no longer possible to write to this stream.
synchronized void reset()
Resets the count field of this output stream to zero, so that all currently accumulated output in the ouput stream is discarded.
synchronized void write(byte[] b, int off, int len)
Writes len bytes from the specified byte array starting at offset off to this output stream.
synchronized void write(int b)
Writes the specified byte to this output stream.
[Expand]
Inherited Methods
From class java.io.ByteArrayOutputStream
From class java.io.OutputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.io.Flushable

Public Constructors

public PosterOutputStream ()

Creates a new output stream for POST user data

Public Methods

public synchronized void close ()

After close() has been called, it is no longer possible to write to this stream. Further calls to write will have no effect.

Throws
IOException

public synchronized void reset ()

Resets the count field of this output stream to zero, so that all currently accumulated output in the ouput stream is discarded. The output stream can be used again, reusing the already allocated buffer space. If the output stream has been closed, then this method has no effect.

See Also

public synchronized void write (byte[] b, int off, int len)

Writes len bytes from the specified byte array starting at offset off to this output stream.

Parameters
b the data.
off the start offset in the data.
len the number of bytes to write.

public synchronized void write (int b)

Writes the specified byte to this output stream.

Parameters
b the byte to be written.