Code example for SessionOutputBuffer

Methods: writeLine

0
        if (!this.wroteLastChunk) { 
            flushCache(); 
            writeClosingChunk(); 
            this.wroteLastChunk = true; 
        } 
    } 
 
    // -------------------------------------------- OutputStream Methods 
    public void write(int b) throws IOException { 
        if (this.closed) { 
            throw new IOException("Attempted write to closed stream."); 
        } 
        this.cache[this.cachePosition] = (byte) b; 
        this.cachePosition++; 
        if (this.cachePosition == this.cache.length) flushCache(); 
    } 
 
    /** 
     * Writes the array. If the array does not fit within the buffer, it is 
     * not split, but rather written out as one large chunk.