home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- /** @deprecated */
- public class LineNumberInputStream extends FilterInputStream {
- int pushBack = -1;
- int lineNumber;
- int markLineNumber;
-
- public LineNumberInputStream(InputStream var1) {
- super(var1);
- }
-
- public int read() throws IOException {
- int var1 = this.pushBack;
- if (var1 != -1) {
- this.pushBack = -1;
- } else {
- var1 = super.in.read();
- }
-
- switch (var1) {
- case 13:
- this.pushBack = super.in.read();
- if (this.pushBack == 10) {
- this.pushBack = -1;
- }
- case 10:
- ++this.lineNumber;
- return 10;
- default:
- return var1;
- }
- }
-
- public int read(byte[] var1, int var2, int var3) throws IOException {
- if (var3 <= 0) {
- return 0;
- } else {
- int var4 = this.read();
- if (var4 == -1) {
- return -1;
- } else {
- var1[var2] = (byte)var4;
- int var5 = 1;
-
- try {
- for(; var5 < var3; ++var5) {
- var4 = this.read();
- if (var4 == -1) {
- break;
- }
-
- if (var1 != null) {
- var1[var2 + var5] = (byte)var4;
- }
- }
- } catch (IOException var6) {
- }
-
- return var5;
- }
- }
- }
-
- public void setLineNumber(int var1) {
- this.lineNumber = var1;
- }
-
- public int getLineNumber() {
- return this.lineNumber;
- }
-
- public long skip(long var1) throws IOException {
- return (long)((FilterInputStream)this).read(new byte[(int)var1]);
- }
-
- public int available() throws IOException {
- return this.pushBack == -1 ? super.available() : super.available() + 1;
- }
-
- public void mark(int var1) {
- this.markLineNumber = this.lineNumber;
- super.in.mark(var1);
- }
-
- public void reset() throws IOException {
- this.lineNumber = this.markLineNumber;
- super.in.reset();
- }
- }
-