home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- /** @deprecated */
- public class StringBufferInputStream extends InputStream {
- protected String buffer;
- protected int pos;
- protected int count;
-
- public StringBufferInputStream(String var1) {
- this.buffer = var1;
- this.count = var1.length();
- }
-
- public synchronized int read() {
- return this.pos < this.count ? this.buffer.charAt(this.pos++) & 255 : -1;
- }
-
- public synchronized int read(byte[] var1, int var2, int var3) {
- if (this.pos >= this.count) {
- return -1;
- } else {
- if (this.pos + var3 > this.count) {
- var3 = this.count - this.pos;
- }
-
- if (var3 <= 0) {
- return 0;
- } else {
- String var4 = this.buffer;
- int var5 = var3;
-
- while(true) {
- --var5;
- if (var5 < 0) {
- return var3;
- }
-
- var1[var2++] = (byte)var4.charAt(this.pos++);
- }
- }
- }
- }
-
- public synchronized long skip(long var1) {
- if (var1 < 0L) {
- return 0L;
- } else {
- if (var1 > (long)(this.count - this.pos)) {
- var1 = (long)(this.count - this.pos);
- }
-
- this.pos = (int)((long)this.pos + var1);
- return var1;
- }
- }
-
- public synchronized int available() {
- return this.count - this.pos;
- }
-
- public synchronized void reset() {
- this.pos = 0;
- }
- }
-