From: madmarcos <fru574@my.utsa.edu>
To: git@vger.kernel.org
Subject: Re: Java Inflater problem decompressing packfile
Date: Sat, 16 Apr 2011 07:58:19 -0700 (PDT) [thread overview]
Message-ID: <1302965899845-6279085.post@n2.nabble.com> (raw)
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.
next prev parent reply other threads:[~2011-04-16 14:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-16 2:05 Java Inflater problem decompressing packfile madmarcos
2011-04-16 6:37 ` Jeff King
2011-04-16 14:23 ` madmarcos
2011-04-16 14:36 ` madmarcos
2011-04-16 14:58 ` madmarcos [this message]
2011-04-16 15:50 ` madmarcos
2011-04-17 0:40 ` madmarcos
2011-04-17 4:02 ` madmarcos
2011-04-17 4:06 ` madmarcos
2011-04-17 4:36 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1302965899845-6279085.post@n2.nabble.com \
--to=fru574@my.utsa.edu \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).