home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / io / Reader.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.2 KB  |  75 lines

  1. package java.io;
  2.  
  3. public abstract class Reader {
  4.    protected Object lock;
  5.    private static final int maxSkipBufferSize = 8192;
  6.    private char[] skipBuffer = null;
  7.  
  8.    protected Reader() {
  9.       this.lock = this;
  10.    }
  11.  
  12.    protected Reader(Object var1) {
  13.       if (var1 == null) {
  14.          throw new NullPointerException();
  15.       } else {
  16.          this.lock = var1;
  17.       }
  18.    }
  19.  
  20.    public int read() throws IOException {
  21.       char[] var1 = new char[1];
  22.       return this.read(var1, 0, 1) == -1 ? -1 : var1[0];
  23.    }
  24.  
  25.    public int read(char[] var1) throws IOException {
  26.       return this.read(var1, 0, var1.length);
  27.    }
  28.  
  29.    public abstract int read(char[] var1, int var2, int var3) throws IOException;
  30.  
  31.    public long skip(long var1) throws IOException {
  32.       if (var1 < 0L) {
  33.          throw new IllegalArgumentException("skip value is negative");
  34.       } else {
  35.          int var3 = (int)Math.min(var1, 8192L);
  36.          Object var4 = this.lock;
  37.          synchronized(var4) {
  38.             if (this.skipBuffer == null || this.skipBuffer.length < var3) {
  39.                this.skipBuffer = new char[var3];
  40.             }
  41.  
  42.             long var5;
  43.             int var7;
  44.             for(var5 = var1; var5 > 0L; var5 -= (long)var7) {
  45.                var7 = this.read(this.skipBuffer, 0, (int)Math.min(var5, (long)var3));
  46.                if (var7 == -1) {
  47.                   break;
  48.                }
  49.             }
  50.  
  51.             long var11 = var1 - var5;
  52.             return var11;
  53.          }
  54.       }
  55.    }
  56.  
  57.    public boolean ready() throws IOException {
  58.       return false;
  59.    }
  60.  
  61.    public boolean markSupported() {
  62.       return false;
  63.    }
  64.  
  65.    public void mark(int var1) throws IOException {
  66.       throw new IOException("mark() not supported");
  67.    }
  68.  
  69.    public void reset() throws IOException {
  70.       throw new IOException("reset() not supported");
  71.    }
  72.  
  73.    public abstract void close() throws IOException;
  74. }
  75.