if (written + count > threshold)
if (!thresholdExceeded && (written + count > threshold))
    protected void checkThreshold(int count) throws IOException    {        if (written + count > threshold)        {            thresholdReached();        }    }