home *** CD-ROM | disk | FTP | other *** search
- package java.util;
-
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.Reader;
-
- class Properties$LineReader {
- byte[] inByteBuf;
- char[] inCharBuf;
- char[] lineBuf;
- int inLimit;
- int inOff;
- InputStream inStream;
- Reader reader;
- // $FF: synthetic field
- final Properties this$0;
-
- public Properties$LineReader(Properties var1, InputStream var2) {
- this.this$0 = var1;
- this.lineBuf = new char[1024];
- this.inLimit = 0;
- this.inOff = 0;
- this.inStream = var2;
- this.inByteBuf = new byte[8192];
- }
-
- public Properties$LineReader(Properties var1, Reader var2) {
- this.this$0 = var1;
- this.lineBuf = new char[1024];
- this.inLimit = 0;
- this.inOff = 0;
- this.reader = var2;
- this.inCharBuf = new char[8192];
- }
-
- int readLine() throws IOException {
- int var1 = 0;
- char var2 = '\u0000';
- boolean var3 = true;
- boolean var4 = false;
- boolean var5 = true;
- boolean var6 = false;
- boolean var7 = false;
- boolean var8 = false;
-
- while(true) {
- if (this.inOff >= this.inLimit) {
- this.inLimit = this.inStream == null ? this.reader.read(this.inCharBuf) : this.inStream.read(this.inByteBuf);
- this.inOff = 0;
- if (this.inLimit <= 0) {
- if (var1 != 0 && !var4) {
- return var1;
- }
-
- return -1;
- }
- }
-
- if (this.inStream != null) {
- var2 = (char)(255 & this.inByteBuf[this.inOff++]);
- } else {
- var2 = this.inCharBuf[this.inOff++];
- }
-
- if (var8) {
- var8 = false;
- if (var2 == '\n') {
- continue;
- }
- }
-
- if (var3) {
- if (var2 == ' ' || var2 == '\t' || var2 == '\f' || !var6 && (var2 == '\r' || var2 == '\n')) {
- continue;
- }
-
- var3 = false;
- var6 = false;
- }
-
- if (var5) {
- var5 = false;
- if (var2 == '#' || var2 == '!') {
- var4 = true;
- continue;
- }
- }
-
- if (var2 != '\n' && var2 != '\r') {
- this.lineBuf[var1++] = var2;
- if (var1 == this.lineBuf.length) {
- int var9 = this.lineBuf.length * 2;
- if (var9 < 0) {
- var9 = Integer.MAX_VALUE;
- }
-
- char[] var10 = new char[var9];
- System.arraycopy(this.lineBuf, 0, var10, 0, this.lineBuf.length);
- this.lineBuf = var10;
- }
-
- if (var2 == '\\') {
- var7 = !var7;
- } else {
- var7 = false;
- }
- } else if (!var4 && var1 != 0) {
- if (this.inOff >= this.inLimit) {
- this.inLimit = this.inStream == null ? this.reader.read(this.inCharBuf) : this.inStream.read(this.inByteBuf);
- this.inOff = 0;
- if (this.inLimit <= 0) {
- return var1;
- }
- }
-
- if (!var7) {
- return var1;
- }
-
- --var1;
- var3 = true;
- var6 = true;
- var7 = false;
- if (var2 == '\r') {
- var8 = true;
- }
- } else {
- var4 = false;
- var5 = true;
- var3 = true;
- var1 = 0;
- }
- }
- }
- }
-