home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / util / Properties$LineReader.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.4 KB  |  136 lines

  1. package java.util;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5. import java.io.Reader;
  6.  
  7. class Properties$LineReader {
  8.    byte[] inByteBuf;
  9.    char[] inCharBuf;
  10.    char[] lineBuf;
  11.    int inLimit;
  12.    int inOff;
  13.    InputStream inStream;
  14.    Reader reader;
  15.    // $FF: synthetic field
  16.    final Properties this$0;
  17.  
  18.    public Properties$LineReader(Properties var1, InputStream var2) {
  19.       this.this$0 = var1;
  20.       this.lineBuf = new char[1024];
  21.       this.inLimit = 0;
  22.       this.inOff = 0;
  23.       this.inStream = var2;
  24.       this.inByteBuf = new byte[8192];
  25.    }
  26.  
  27.    public Properties$LineReader(Properties var1, Reader var2) {
  28.       this.this$0 = var1;
  29.       this.lineBuf = new char[1024];
  30.       this.inLimit = 0;
  31.       this.inOff = 0;
  32.       this.reader = var2;
  33.       this.inCharBuf = new char[8192];
  34.    }
  35.  
  36.    int readLine() throws IOException {
  37.       int var1 = 0;
  38.       char var2 = '\u0000';
  39.       boolean var3 = true;
  40.       boolean var4 = false;
  41.       boolean var5 = true;
  42.       boolean var6 = false;
  43.       boolean var7 = false;
  44.       boolean var8 = false;
  45.  
  46.       while(true) {
  47.          if (this.inOff >= this.inLimit) {
  48.             this.inLimit = this.inStream == null ? this.reader.read(this.inCharBuf) : this.inStream.read(this.inByteBuf);
  49.             this.inOff = 0;
  50.             if (this.inLimit <= 0) {
  51.                if (var1 != 0 && !var4) {
  52.                   return var1;
  53.                }
  54.  
  55.                return -1;
  56.             }
  57.          }
  58.  
  59.          if (this.inStream != null) {
  60.             var2 = (char)(255 & this.inByteBuf[this.inOff++]);
  61.          } else {
  62.             var2 = this.inCharBuf[this.inOff++];
  63.          }
  64.  
  65.          if (var8) {
  66.             var8 = false;
  67.             if (var2 == '\n') {
  68.                continue;
  69.             }
  70.          }
  71.  
  72.          if (var3) {
  73.             if (var2 == ' ' || var2 == '\t' || var2 == '\f' || !var6 && (var2 == '\r' || var2 == '\n')) {
  74.                continue;
  75.             }
  76.  
  77.             var3 = false;
  78.             var6 = false;
  79.          }
  80.  
  81.          if (var5) {
  82.             var5 = false;
  83.             if (var2 == '#' || var2 == '!') {
  84.                var4 = true;
  85.                continue;
  86.             }
  87.          }
  88.  
  89.          if (var2 != '\n' && var2 != '\r') {
  90.             this.lineBuf[var1++] = var2;
  91.             if (var1 == this.lineBuf.length) {
  92.                int var9 = this.lineBuf.length * 2;
  93.                if (var9 < 0) {
  94.                   var9 = Integer.MAX_VALUE;
  95.                }
  96.  
  97.                char[] var10 = new char[var9];
  98.                System.arraycopy(this.lineBuf, 0, var10, 0, this.lineBuf.length);
  99.                this.lineBuf = var10;
  100.             }
  101.  
  102.             if (var2 == '\\') {
  103.                var7 = !var7;
  104.             } else {
  105.                var7 = false;
  106.             }
  107.          } else if (!var4 && var1 != 0) {
  108.             if (this.inOff >= this.inLimit) {
  109.                this.inLimit = this.inStream == null ? this.reader.read(this.inCharBuf) : this.inStream.read(this.inByteBuf);
  110.                this.inOff = 0;
  111.                if (this.inLimit <= 0) {
  112.                   return var1;
  113.                }
  114.             }
  115.  
  116.             if (!var7) {
  117.                return var1;
  118.             }
  119.  
  120.             --var1;
  121.             var3 = true;
  122.             var6 = true;
  123.             var7 = false;
  124.             if (var2 == '\r') {
  125.                var8 = true;
  126.             }
  127.          } else {
  128.             var4 = false;
  129.             var5 = true;
  130.             var3 = true;
  131.             var1 = 0;
  132.          }
  133.       }
  134.    }
  135. }
  136.