rendered paste body public JagFile(byte filebytes[])
{
loadstream(filebytes);
}
private void loadstream(byte filebytes[])
{
ByteStream aStream = new ByteStream(filebytes);
int i = aStream.Read3Bytes();
int j = aStream.Read3Bytes();
if(j != i)
{
byte abyte1[] = new byte[i];
PackJAG.method73(abyte1, i, filebytes, j, 6);
fbytes = abyte1;
aStream = new ByteStream(fbytes);
decompressed = true;
} else
{
fbytes = filebytes;
decompressed = false;
}
datasize = aStream.ReadUnsignedWord();
filename = new int[datasize];
filesize = new int[datasize];
filelength = new int[datasize];
filestart = new int[datasize];
int k = aStream.Offset + datasize * 10;
for(int l = 0; l < datasize; l++)
{
filename[l] = aStream.ReadDWord();
filesize[l] = aStream.Read3Bytes();
filelength[l] = aStream.Read3Bytes();
filestart[l] = k;
k += filelength[l];
}
}
public byte[] readfile(String s, byte abyte0[])
{
int i = 0;
s = s.toUpperCase();
for(int j = 0; j < s.length(); j++)
i = (i * 61 + s.charAt(j)) - 32;
for(int k = 0; k < datasize; k++)
if(filename[k] == i)
{
if(abyte0 == null)
abyte0 = new byte[filesize[k]];
if(!decompressed)
{
PackJAG.method73(abyte0, filesize[k], fbytes, filelength[k], filestart[k]);
} else
{
for(int l = 0; l < filesize[k]; l++)
abyte0[l] = fbytes[filestart[k] + l];
}
return abyte0;
}
return null;
}
public byte[] readfile(int k, byte abyte0[])
{
if(abyte0 == null)
abyte0 = new byte[filesize[k]];
if(!decompressed)
{
PackJAG.method73(abyte0, filesize[k], fbytes, filelength[k], filestart[k]);
} else
{
for(int l = 0; l < filesize[k]; l++)
abyte0[l] = fbytes[filestart[k] + l];
}
return abyte0;
}
public byte fbytes[];
public int datasize;
public int filename[];
public int filesize[];
public int filelength[];
public int filestart[];
private boolean decompressed;