Class Overview
A stream that has the property of being able to be kept alive for
multiple downloads from the same server.
Summary
Public Methods |
void
|
close()
Attempt to cache this connection
|
synchronized
boolean
|
hurry()
|
void
|
mark(int limit)
Marks the current position in this input stream.
|
boolean
|
markSupported()
Tests if this input stream supports the mark
and reset methods.
|
void
|
reset()
Repositions this stream to the position at the time the
mark method was last called on this input stream.
|
[Expand]
Inherited Methods |
From class
sun.net.www.MeteredStream
synchronized
int
|
available()
Returns an estimate of the number of bytes that can be read (or
skipped over) from this input stream without blocking by the next
caller of a method for this input stream.
|
void
|
close()
Closes this input stream and releases any system resources
associated with the stream.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
synchronized
void
|
mark(int readLimit)
Marks the current position in this input stream.
|
boolean
|
markSupported()
Tests if this input stream supports the mark
and reset methods.
|
synchronized
int
|
read()
Reads the next byte of data from this input stream.
|
synchronized
int
|
read(byte[] b, int off, int len)
Reads up to len bytes of data from this input stream
into an array of bytes.
|
synchronized
void
|
reset()
Repositions this stream to the position at the time the
mark method was last called on this input stream.
|
synchronized
long
|
skip(long n)
Skips over and discards n bytes of data from this input
stream.
This method simply performs in.skip(n) .
|
|
From class
java.io.FilterInputStream
|
From class
java.io.InputStream
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.io.Closeable
abstract
void
|
close()
Closes this stream and releases any system resources associated
with it.
|
|
From interface
sun.net.www.http.Hurryable
|
Fields
protected
boolean
queuedForCleanup
Public Constructors
Public Methods
public
void
close
()
Attempt to cache this connection
public
synchronized
boolean
hurry
()
public
void
mark
(int limit)
Marks the current position in this input stream. A subsequent
call to the reset
method repositions this stream at
the last marked position so that subsequent reads re-read the same bytes.
The readlimit
argument tells this input stream to
allow that many bytes to be read before the mark position gets
invalidated.
This method simply performs in.mark(readlimit)
.
Parameters
limit
| the maximum limit of bytes that can be read before
the mark position becomes invalid. |
public
boolean
markSupported
()
Tests if this input stream supports the mark
and reset
methods.
This method
simply performs in.markSupported()
.
Returns
true
if this stream type supports the
mark
and reset
method;
false
otherwise.
public
void
reset
()
Repositions this stream to the position at the time the
mark
method was last called on this input stream.
This method
simply performs in.reset()
.
Stream marks are intended to be used in
situations where you need to read ahead a little to see what's in
the stream. Often this is most easily done by invoking some
general parser. If the stream is of the type handled by the
parse, it just chugs along happily. If the stream is not of
that type, the parser should toss an exception when it fails.
If this happens within readlimit bytes, it allows the outer
code to reset the stream and try another parser.
Protected Methods
protected
int
remainingToRead
()
protected
void
setClosed
()