public synchronized DataInputStream getChunkDataInputStream(int par1, int par2)
    {
        if (this.outOfBounds(par1, par2))
        {
            this.debugln("READ", par1, par2, "out of bounds");
            return null;
        }
        else
        {
            try
            {
                int var3 = this.getOffset(par1, par2);

                if (var3 == 0)
                {
                    return null;
                }
                else
                {
                    int var4 = var3 >> 8;
                    int var5 = var3 & 255;

                    if (var4 + var5 > this.sectorFree.size())
                    {
                        this.debugln("READ", par1, par2, "invalid sector");
                        return null;
                    }
                    else
                    {
                        this.dataFile.seek((long)(var4 * 4096));
                        int var6 = this.dataFile.readInt();

                        if (var6 > 4096 * var5)
                        {
                            this.debugln("READ", par1, par2, "invalid length: " + var6 + " > 4096 * " + var5);
                            return null;
                        }
                        else if (var6 <= 0)
                        {
                            this.debugln("READ", par1, par2, "invalid length: " + var6 + " < 1");
                            return null;
                        }
                        else
                        {
                            byte var7 = this.dataFile.readByte();
                            byte[] var8;
                            DataInputStream var9;

                            if (var7 == 1)
                            {
                                var8 = new byte[var6 - 1];
                                this.dataFile.read(var8);
                                var9 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(var8))));
                                return var9;
                            }
                            else if (var7 == 2)
                            {
                                var8 = new byte[var6 - 1];
                                this.dataFile.read(var8);
                                var9 = new DataInputStream(new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(var8))));
                                return var9;
                            }
                            else
                            {
                                this.debugln("READ", par1, par2, "unknown version " + var7);
                                return null;
                            }
                        }
                    }
                }
            }
            catch (IOException var10)
            {
                this.debugln("READ", par1, par2, "exception");
                return null;
            }
        }
    }