if (work == null) { work = new char[100]; wpos = 0; wcount = 0; } for (;;) { if (in.available() <= 0) return false; in.mark(1); int b = in.read(); if (b < 0) return true; in.reset(); converter.setInput(in.buf, in.pos, in.count); wpos = 0; wcount = converter.read(work, 0, work.length); in.skip(converter.inpos - in.pos); if (wcount > 0) return true; }
return in.available () > 0;
  public boolean ready() throws IOException  {    synchronized (lock)      {	if (in == null)	  throw new IOException("Stream closed");	if (wpos < wcount)	  return true;	if (work == null)	  {	    work = new char[100];	    wpos = 0;	    wcount = 0;	  }	for (;;)	  {	    if (in.available() <= 0)	      return false;	    in.mark(1);	    int b = in.read();	    if (b < 0)	      return true;	    in.reset();	    converter.setInput(in.buf, in.pos, in.count);	    wpos = 0;	    wcount = converter.read(work, 0, work.length);	    in.skip(converter.inpos - in.pos);	    if (wcount > 0)	      return true;	  }      }  }