/*
 * Java core library component.
 *
 * Copyright (c) 1997, 1998
 *      Transvirtual Technologies, Inc.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file.
 */

package java.io;

abstract public class InputStream extends Object {

public int available() throws IOException {
	return 0;
}

public void close() throws IOException {
	/* Do nothing */
}

public synchronized void mark(int readlimit) {
	/* Do nothing */
}

public boolean markSupported() {
	return false;
}

abstract public int read() throws IOException;

public int read(byte b[]) throws IOException {
	return read(b, 0, b.length);
}

public int read(byte b[], int off, int len) throws IOException {
	if (b==null) {
		return (int )skip((long )len);
	}
	else {
		for (int pos=off; pos<off+len; pos++) {
			int data=read();
			if (data==-1) {
				if (pos-off==0) return -1; else return pos-off;
			}
			b[pos]=(byte )data;
		}
	}

	return len;
}

public synchronized void reset() throws IOException {
	throw new IOException();
}

public long skip(long n) throws IOException {
	byte junk[]=new byte[(int )n];

	return (long)read(junk);
}
}

@@ -1107,62 +1107,202 @@
 byte
- junk%5B%5D=new byte%5B(int )n%5D;%0A%0A%09return (long)read(junk)
+%5B%5D buf = new char%5B1024%5D;%0A%09int skipped = 0;%0A%0A%09while (n %3E 0) %7B%0A%09%09int r = read(buf, 0, buf.length %3C n ? buf.length : (int)n);%0A%09%09if (r %3C= 0)%0A%09%09%09break;%0A%09%09n -= r;%0A%09%09skipped += r;%0A%09%7D%0A%09return skipped
 ;%0A%7D%0A
+%0A
 %7D%0A

Make skip() behave according to the JDK spec: