this.stream = stream; this.startingPos = stream.getStreamPosition(); this.startingLength = this.length = length;
// Empty finalizer (for improved performance; no need to call // super.finalize() in this case)
return startingLength;
if (length == 0) { // Local EOF return -1; } else { --length; return stream.read(); }
if (length == 0) { // Local EOF return -1; } len = Math.min(len, length); int bytes = stream.read(b, off, len); length -= bytes; return bytes;
stream.seek(pos - startingPos); streamPos = pos;