notifyAll();
}
- private class SubStream extends InputStream {
+ private class SubStream extends InputStream implements KnownLength {
int pos = 0;
public int available() { return Math.max(0, size - pos); }
public long skip(long n) throws IOException { pos += (int)n; return n; } // FEATURE: don't skip past EOF
+ public int getLength() { return eof ? size : is instanceof KnownLength ? ((KnownLength)is).getLength() : 0; }
public int read() throws IOException { // FEATURE: be smarter here
byte[] b = new byte[1];
int ret = read(b, 0, 1);