home *** CD-ROM | disk | FTP | other *** search
- package netscape.net;
-
- import java.io.IOException;
- import java.io.InputStream;
-
- public class URLInputStream extends InputStream {
- protected URLConnection connection;
-
- public URLInputStream(URLConnection con) {
- this.connection = con;
- }
-
- protected native void open() throws IOException;
-
- public int read() throws IOException {
- byte[] b = new byte[1];
- int result = this.read(b, 0, 1);
- return result == -1 ? result : b[0] & 255;
- }
-
- public native int read(byte[] var1, int var2, int var3) throws IOException;
-
- public native int available() throws IOException;
-
- public void close() throws IOException {
- this.connection.close();
- }
- }
-