Re: Java Inflater problem decompressing packfile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



here is some code that shows the problem. sorry if the formatting fails. not
sure if I am supposed to use code tags or something.


		try {
			byte[] packFile = readFile("/Users/marcos/GitProxyCache/jedit.pack");
			
			//THE BELOW OBJECT DECOMPRESSES FINE
       		//Object starts at index 8616
       		//Type = 3, Decompressed size = 2248 (uses 2 extra size bytes)
			//byte [] packDataWindow = new byte[8000];
			//System.arraycopy(packFile, 8619, packDataWindow, 0,
packDataWindow.length); //works
			
			//THE BELOW OBJECT FAILS TO INFLATE
			//IT CAUSES an "incorrect data check" error
       		//Object starts at index 9470
       		//Type = 3, Decompressed size = 51060 (uses 2 extra size bytes)
			byte [] packDataWindow = new byte[8000];
			System.arraycopy(packFile, 9473, packDataWindow, 0,
packDataWindow.length); //does not work

			Inflater decompresser = new Inflater();
			decompresser.setInput(packDataWindow, 0, packDataWindow.length);
			byte[] result = new byte[60000];
			int resultLength = 0;
			resultLength = decompresser.inflate(result);
			String outputString = new String(result, 0, resultLength, "UTF-8");
			System.out.println(outputString);
			decompresser.end();
		} catch (Exception e) {
			e.printStackTrace();
		}


--
View this message in context: http://git.661346.n2.nabble.com/Java-Inflater-problem-decompressing-packfile-tp6278154p6279085.html
Sent from the git mailing list archive at Nabble.com.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]