protected int fillBuffer()
        throws IOException {

        final String fname = OBJECTID + ".fillBuffer(): ";

        int n;
        try {
            if(LOG.isDebug()) {
                LOG.debug(fname, "trying to read " + m_buf.length);
            }

            n = m_in.read(m_buf);
            if(LOG.isDebug()) {
                LOG.debug(fname, "read " + n
                          + " m_in.available() now: " + m_in.available());
            }

            if (n == -1) {
                m_eof = true;
            }
            else {
                m_nextPos = 0;
                m_count = n;
            }

            return n;
        }
        catch (IOException e) {
            if(LOG.isError()) {
                LOG.error(fname, "IOE: " + e);
            }

            m_eof = true;
            throw e;
        }
    }