| java.lang.Object | ||
| ↳ | java.io.OutputStream | |
| ↳ | org.apache.http.impl.io.ContentLengthOutputStream | |
A stream wrapper that closes itself after a defined number of bytes.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Creates a new length limited stream
|
||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Does not close the underlying socket output. |
||||||||||
|
|
Flushes this stream.
|
||||||||||
|
|
Writes
count
bytes from the byte array
buffer
starting at
position
offset
to this stream.
|
||||||||||
|
|
Equivalent to
write(buffer, 0, buffer.length)
.
|
||||||||||
|
|
Writes a single byte to this stream.
|
||||||||||
|
[Expand]
Inherited Methods
|
|||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.OutputStream
|
|||||||||||
From class
java.lang.Object
|
|||||||||||
From interface
java.io.Closeable
|
|||||||||||
From interface
java.io.Flushable
|
|||||||||||
From interface
java.lang.AutoCloseable
|
|||||||||||
Creates a new length limited stream
| out | The data transmitter to wrap |
|---|---|
| contentLength | The maximum number of bytes that can be written to the stream. Subsequent write operations will be ignored. |
Does not close the underlying socket output.
| IOException | If an I/O problem occurs. |
|---|
Flushes this stream. Implementations of this method should ensure that any buffered data is written out. This implementation does nothing.
| IOException |
|---|
Writes
count
bytes from the byte array
buffer
starting at
position
offset
to this stream.
| b | the buffer to be written. |
|---|---|
| off |
the start position in
buffer
from where to get bytes.
|
| len |
the number of bytes from
buffer
to write to this
stream.
|
| IOException |
|---|
Equivalent to
write(buffer, 0, buffer.length)
.
| IOException |
|---|
Writes a single byte to this stream. Only the least significant byte of
the integer
oneByte
is written to the stream.
| b | the byte to be written. |
|---|
| IOException |
|---|