public int read(byte b[], int off, int len) throws IOException { if (eos) { return -1; }  int bytesRead = 0; while (!eos && (len > 0)) { fillConvbuffer();  if (!eos) { int bytesToCopy = Math.min(len, convbufferSize-convbufferOff); System.arraycopy(convbuffer, convbufferOff, b, off, bytesToCopy); convbufferOff += bytesToCopy; bytesRead += bytesToCopy; len -= bytesToCopy; off += bytesToCopy; } }  return bytesRead;
public int read() throws IOException { int retVal = read(readDummy, 0, 1); return (retVal == -1 ? -1 : readDummy[0]);
    public int read(byte b[], int off, int len) throws IOException {        if (eos) {            return -1;        }        int bytesRead = 0;        while (!eos && (len > 0)) {            fillConvbuffer();                        if (!eos) {                int bytesToCopy = Math.min(len, convbufferSize-convbufferOff);                System.arraycopy(convbuffer, convbufferOff, b, off, bytesToCopy);                convbufferOff += bytesToCopy;                bytesRead += bytesToCopy;                len -= bytesToCopy;                off += bytesToCopy;            }        }        return bytesRead;    }