git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Java Inflater problem decompressing packfile

From
Mmadmarcos <fru574@my.utsa.edu>
Date
Apr 16, 2011, 14:58 UTC
Message-ID
<1302965899845-6279085.post@n2.nabble.com>
In-Reply-To
<1302964576373-6279050.post@n2.nabble.com>

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.

Previous: madmarcosNext: madmarcos
Message 5 of 10 in “Java Inflater problem decompressing packfile”
  1. madmarcosApr 16, 2011
  2. Jeff KingApr 16, 2011
  3. madmarcosApr 16, 2011
  4. madmarcosApr 16, 2011
  5. madmarcosApr 16, 2011
  6. madmarcosApr 16, 2011
  7. madmarcosApr 17, 2011
  8. madmarcosApr 17, 2011
  9. madmarcosApr 17, 2011
  10. Jeff KingApr 17, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.