public class StringDataInputStream{
int pos=-1;
char[] c;

public StringDataInputStream(String s){
c = s.toCharArray();
}

public int read(){
pos++;
try{
char c2 = c[pos];
return (int) c[pos];
} catch (Exception e){}
pos--;
return -1;
}

}