public void stopBuffering() {

        if (buffer == null) {
            return;
        }