APIdia Launch Partner
Top Description Fields Constructors Methods
sun.net.httpserver

pack-priv abstract Class LeftOverInputStream

extends FilterInputStream
Class Inheritance
Known Direct Subclasses
sun.net.httpserver.ChunkedInputStream, sun.net.httpserver.FixedLengthInputStream
Imports
java.io.*, com.sun.net.httpserver.*, com.sun.net.httpserver.spi.*

a (filter) input stream which can tell us if bytes are "left over" on the underlying stream which can be read (without blocking) on another instance of this class. The class can also report if all bytes "expected" to be read were read, by the time close() was called. In that case, bytes may be drained to consume them (by calling drain() ). isEOF() returns true, when all expected bytes have been read

Field Summary

Modifier and TypeField and Description
protected boolean
protected boolean
private static final int
pack-priv byte[]
pack-priv final ServerImpl
pack-priv final ExchangeImpl
t

Inherited from java.io.FilterInputStream:
in

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterInputStream.close.

Implements java.io.Closeable.close.

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

public boolean
drain(long l)

read and discard up to l bytes or "eof" occurs, (whichever is first).

public boolean
public boolean
isDataBuffered()

if bytes are left over buffered on *the UNDERLYING* stream

public boolean
public synchronized int
read()

Overrides java.io.FilterInputStream.read.

Reads the next byte of data from the input stream.

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

Overrides java.io.FilterInputStream.read.

Reads up to len bytes of data from this input stream into an array of bytes.

protected abstract int
readImpl(byte[] b, int off, int len)

public synchronized long
skip(long n)

Overrides java.io.FilterInputStream.skip.

Skips over and discards n bytes of data from the input stream.

Inherited from java.io.FilterInputStream:
availablemarkmarkSupportedreadreset

Field Detail

closedback to summary
protected boolean closed
eofback to summary
protected boolean eof
MAX_SKIP_BUFFER_SIZEback to summary
private static final int MAX_SKIP_BUFFER_SIZE

Hides java.io.InputStream.MAX_SKIP_BUFFER_SIZE.

oneback to summary
pack-priv byte[] one
serverback to summary
pack-priv final ServerImpl server
tback to summary
pack-priv final ExchangeImpl t

Constructor Detail

LeftOverInputStreamback to summary
public LeftOverInputStream(ExchangeImpl t, InputStream src)

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.FilterInputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.FilterInputStream.close.

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

Exceptions
IOException:
if an I/O error occurs.
drainback to summary
public boolean drain(long l) throws IOException

read and discard up to l bytes or "eof" occurs, (whichever is first). Then return true if the stream is at eof (ie. all bytes were read) or false if not (still bytes to be read)

isClosedback to summary
public boolean isClosed()
isDataBufferedback to summary
public boolean isDataBuffered() throws IOException

if bytes are left over buffered on *the UNDERLYING* stream

isEOFback to summary
public boolean isEOF()
readback to summary
public synchronized int read() throws IOException

Overrides java.io.FilterInputStream.read.

Doc from java.io.FilterInputStream.read.

Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

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

Overrides java.io.FilterInputStream.read.

Doc from java.io.FilterInputStream.read.

Reads up to len bytes of data from this input stream into an array of bytes. If len is not zero, the method blocks until some input is available; otherwise, no bytes are read and 0 is returned.

Exceptions
IOException:
if an I/O error occurs.
readImplback to summary
protected abstract int readImpl(byte[] b, int off, int len) throws IOException
skipback to summary
public synchronized long skip(long n) throws IOException

Overrides java.io.FilterInputStream.skip.

Doc from java.io.FilterInputStream.skip.

Skips over and discards n bytes of data from the input stream. The skip method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly 0. The actual number of bytes skipped is returned.

Annotations
@Override
Exceptions
IOException:
if in.skip(n) throws an IOException.