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

Re: [JGIT PATCH 2/5] Add copy(InputStream) to TemporaryBuffer

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Dec 11, 2008, 15:40 UTC
Message-ID
<200812111640.34435.robin.rosenberg@dewire.com>
In-Reply-To
<1228971522-28764-3-git-send-email-spearce@spearce.org>
torsdag 11 december 2008 05:58:39 skrev Shawn O. Pearce:
Show 6 quoted lines
> In some places we may find it ourselves with an InputStream we
> need to copy into a TemporaryBuffer, so we can flatten out the
> entire stream to a single byte[].  Putting the copy loop here
> is more useful then duplicating it in application level code.
> +	public void copy(final InputStream in) throws IOException {
> +		final byte[] b = new byte[2048];
Why not 8192 here too?
-- robin
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 13 of 15 in “Patch parsing API”
  1. 0/5 Patch parsing APIShawn O. Pearce, Dec 11, 2008
  2. 1/5 Add toByteArray() to TemporaryBufferShawn O. Pearce, Dec 11, 2008
  3. 2/5 Add copy(InputStream) to TemporaryBufferShawn O. Pearce, Dec 11, 2008
  4. 3/5 Define FileHeader to parse the header block of a git diffShawn O. Pearce, Dec 11, 2008
  5. 4/5 Define Patch to parse a sequence of patch FileHeadersShawn O. Pearce, Dec 11, 2008
  6. 5/5 Add HunkHeader to represent a single hunk of a file within a patchShawn O. Pearce, Dec 11, 2008
  7. Robin RosenbergDec 11, 2008
  8. Shawn O. PearceDec 11, 2008
  9. Robin RosenbergDec 11, 2008
  10. Shawn O. PearceDec 11, 2008
  11. Robin RosenbergDec 11, 2008
  12. Shawn O. PearceDec 11, 2008
  13. Robin RosenbergDec 11, 2008
  14. Shawn O. PearceDec 11, 2008
  15. 2/5 Add copy(InputStream) to TemporaryBufferShawn O. Pearce, Dec 11, 2008

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.