Code example for DeflaterOutputStream

0
    /** 
     * args: x, z - get an output stream used to write chunk data, data is on disk when the returned stream is closed 
     */ 
    public DataOutputStream getChunkDataOutputStream(int par1, int par2)
    { 
        return this.outOfBounds(par1, par2) ? null : new DataOutputStream(new DeflaterOutputStream(new RegionFileChunkBuffer(this, par1, par2)));
    } 
 
    /** 
     * args: x, z, data, length - write chunk data at (x, z) to disk 
     */ 
    protected synchronized void write(int par1, int par2, byte[] par3ArrayOfByte, int par4)
    { 
        try 
        { 
            int l = this.getOffset(par1, par2);
            int i1 = l >> 8;
            int j1 = l & 255;
            int k1 = (par4 + 5) / 4096 + 1;
 
            if (k1 >= 256)