home *** CD-ROM | disk | FTP | other *** search
- package java.util.jar;
-
- import java.io.FilterInputStream;
- import java.io.IOException;
- import java.io.InputStream;
-
- class Manifest$FastInputStream extends FilterInputStream {
- private byte[] buf;
- private int count;
- private int pos;
-
- Manifest$FastInputStream(InputStream var1) {
- this(var1, 8192);
- }
-
- Manifest$FastInputStream(InputStream var1, int var2) {
- super(var1);
- this.count = 0;
- this.pos = 0;
- this.buf = new byte[var2];
- }
-
- public int read() throws IOException {
- if (this.pos >= this.count) {
- this.fill();
- if (this.pos >= this.count) {
- return -1;
- }
- }
-
- return this.buf[this.pos++] & 255;
- }
-
- public int read(byte[] var1, int var2, int var3) throws IOException {
- int var4 = this.count - this.pos;
- if (var4 <= 0) {
- if (var3 >= this.buf.length) {
- return super.in.read(var1, var2, var3);
- }
-
- this.fill();
- var4 = this.count - this.pos;
- if (var4 <= 0) {
- return -1;
- }
- }
-
- if (var3 > var4) {
- var3 = var4;
- }
-
- System.arraycopy(this.buf, this.pos, var1, var2, var3);
- this.pos += var3;
- return var3;
- }
-
- public int readLine(byte[] var1, int var2, int var3) throws IOException {
- byte[] var4 = this.buf;
- int var5 = 0;
-
- while(var5 < var3) {
- int var6 = this.count - this.pos;
- if (var6 <= 0) {
- this.fill();
- var6 = this.count - this.pos;
- if (var6 <= 0) {
- return -1;
- }
- }
-
- int var7 = var3 - var5;
- if (var7 > var6) {
- var7 = var6;
- }
-
- int var8 = this.pos;
- int var9 = var8 + var7;
-
- while(var8 < var9 && var4[var8++] != 10) {
- }
-
- var7 = var8 - this.pos;
- System.arraycopy(var4, this.pos, var1, var2, var7);
- var2 += var7;
- var5 += var7;
- this.pos = var8;
- if (var4[var8 - 1] == 10) {
- break;
- }
- }
-
- return var5;
- }
-
- public byte peek() throws IOException {
- if (this.pos == this.count) {
- this.fill();
- }
-
- return this.buf[this.pos];
- }
-
- public int readLine(byte[] var1) throws IOException {
- return this.readLine(var1, 0, var1.length);
- }
-
- public long skip(long var1) throws IOException {
- if (var1 <= 0L) {
- return 0L;
- } else {
- long var3 = (long)(this.count - this.pos);
- if (var3 <= 0L) {
- return super.in.skip(var1);
- } else {
- if (var1 > var3) {
- var1 = var3;
- }
-
- this.pos = (int)((long)this.pos + var1);
- return var1;
- }
- }
- }
-
- public int available() throws IOException {
- return this.count - this.pos + super.in.available();
- }
-
- public void close() throws IOException {
- if (super.in != null) {
- super.in.close();
- super.in = null;
- this.buf = null;
- }
-
- }
-
- private void fill() throws IOException {
- this.count = this.pos = 0;
- int var1 = super.in.read(this.buf, 0, this.buf.length);
- if (var1 > 0) {
- this.count = var1;
- }
-
- }
- }
-