APISonar


org.osgl.util.IO.close

> org > osgl > util > IO > close
org APIs osgl APIs util APIs IO APIs close APIs

Example 1
protected void applyMessage(H.Request request, H.Response response) {
        String msg = this.getMessage();
        this.applyBeforeCommitHandler(request, response);
        if(S.notBlank(msg)) {
            renderCode(response);
        } else {
            IO.close(response.outputStream());
        }

        this.applyAfterCommitHandler(request, response);
    }
Example 2
public void commit() {
        if (!committed) {
            byte[] ba = baos.toByteArray();
            ByteBuffer buffer = ByteBuffer.allocateDirect(ba.length);
            buffer.put(ba);
            buffer.flip();
            this.buffer = buffer;
            out.append(ba);
            IO.close(out);
            committed = true;
        }
    }