Top Description Fields Constructors Methods
sun.net.httpserver

pack-priv Class FixedLengthOutputStream

extends FilterOutputStream
Class Inheritance
Imports
java.io.*, java.net.*, java.util.Objects, com.sun.net.httpserver.*, com.sun.net.httpserver.spi.*

a class which allows the caller to write up to a defined number of bytes to an underlying stream. The caller *must* write the pre-defined number or else an exception will be thrown and the whole request aborted. normal close() does not close the underlying stream

Field Summary

Modifier and TypeField and Description
private boolean
private long
pack-priv ExchangeImpl
t

Inherited from java.io.FilterOutputStream:
out

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with the stream.
public void
write(int
the byte.
b
)

Overrides java.io.FilterOutputStream.write.

Writes the specified byte to this output stream.
public void
write(byte[]
the data.
b
,
int
the start offset in the data.
off
,
int
the number of bytes to write.
len
)

Overrides java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.
Inherited from java.io.FilterOutputStream:
flushwrite

Field Detail

closedback to summary
private boolean closed

Hides java.io.FilterOutputStream.closed.

remainingback to summary
private long remaining
tback to summary
pack-priv ExchangeImpl t

Constructor Detail

FixedLengthOutputStreamback to summary
pack-priv FixedLengthOutputStream(ExchangeImpl t, OutputStream src, long len)

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.FilterOutputStream.close.

Closes this output stream and releases any system resources associated with the stream.

Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(int b) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes the specified byte to this output stream.

The write method of FilterOutputStream calls the write method of its underlying output stream, that is, it performs out.write(b).

Implements the abstract write method of OutputStream.

Parameters
b:int

the byte.

Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

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

Parameters
b:byte[]

the data.

off:int

the start offset in the data.

len:int

the number of bytes to write.

Exceptions
IOException:
if an I/O error occurs.