home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / rt.jar / java / io / Reader.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-23  |  1.3 KB  |  73 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;
  7.  
  8.    protected Reader() {
  9.       this.lock = this;
  10.    }
  11.  
  12.    protected Reader(Object var1) {
  13.       this.lock = var1;
  14.    }
  15.  
  16.    public int read() throws IOException {
  17.       char[] var1 = new char[1];
  18.       return this.read(var1, 0, 1) == -1 ? -1 : var1[0];
  19.    }
  20.  
  21.    public int read(char[] var1) throws IOException {
  22.       return this.read(var1, 0, var1.length);
  23.    }
  24.  
  25.    public abstract int read(char[] var1, int var2, int var3) throws IOException;
  26.  
  27.    public long skip(long var1) throws IOException {
  28.       int var3 = (int)Math.min(var1, 8192L);
  29.       Object var6 = this.lock;
  30.       synchronized(var6){}
  31.  
  32.       long var4;
  33.       try {
  34.          if (this.skipBuffer == null || this.skipBuffer.length < var3) {
  35.             this.skipBuffer = new char[var3];
  36.          }
  37.  
  38.          long var8;
  39.          int var10;
  40.          for(var8 = var1; var8 > 0L; var8 -= (long)var10) {
  41.             var10 = this.read(this.skipBuffer, 0, var3);
  42.             if (var10 == -1) {
  43.                break;
  44.             }
  45.          }
  46.  
  47.          var4 = var1 - var8;
  48.       } catch (Throwable var12) {
  49.          throw var12;
  50.       }
  51.  
  52.       return var4;
  53.    }
  54.  
  55.    public boolean ready() throws IOException {
  56.       return false;
  57.    }
  58.  
  59.    public boolean markSupported() {
  60.       return false;
  61.    }
  62.  
  63.    public void mark(int var1) throws IOException {
  64.       throw new IOException("mark() not supported");
  65.    }
  66.  
  67.    public void reset() throws IOException {
  68.       throw new IOException("reset() not supported");
  69.    }
  70.  
  71.    public abstract void close() throws IOException;
  72. }
  73.