1 public class bytereader {
8 public bytereader(FileInputStream fis) {
10 this.buffer=new byte[1024];
11 this.tmp=new byte[200];
16 public void jumptonextline() {
18 for(;pos<lastlocation;pos++) {
19 if (buffer[pos]=='\n') {
24 if (pos==lastlocation) {
30 private void readnewdata() {
32 lastlocation=fis.read(buffer);
39 private void skipline() {
46 String str=new String(curbuffer, start, end-start);
47 return Integer.parseInt(str);
50 public double getDouble() {
52 String str=new String(curbuffer, start, end-start);
53 return Double.parseDouble(str);
56 private void getBytes() {
57 boolean searching=true;
59 for(;pos<lastlocation;pos++) {
60 if (buffer[pos]!=' '&&buffer[pos]!='\n'&&buffer[pos]!='\t') {
70 for(;pos<lastlocation;pos++) {
71 if (buffer[pos]==' '||
81 for(int i=start;i<lastlocation;i++) {
82 tmp[i-start]=buffer[i];
85 start=lastlocation-start;
86 for(;pos<lastlocation;pos++) {
87 if (buffer[pos]==' '||
95 tmp[pos+start]=buffer[pos];