home *** CD-ROM | disk | FTP | other *** search
/ Online Today 2000 January / Onto0100.iso / pc / JAVA / MSJAVX86.EXE / xmldso.cab / com / ms / xml / util / StringInputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  541 b   |  21 lines

  1. package com.ms.xml.util;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5.  
  6. public class StringInputStream extends InputStream {
  7.    int size;
  8.    int index;
  9.    String buf;
  10.  
  11.    public StringInputStream(String var1) {
  12.       this.size = var1.length();
  13.       this.index = 0;
  14.       this.buf = var1;
  15.    }
  16.  
  17.    public int read() throws IOException {
  18.       return this.index < this.size ? this.buf.charAt(this.index++) : -1;
  19.    }
  20. }
  21.