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

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

 



Robin Rosenberg <robin.rosenberg@xxxxxxxxxx> wrote:
> torsdag 11 december 2008 05:58:39 skrev Shawn O. Pearce:
> > 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?

Blargh, you're right.  Actually what I should do is look to see
if blocks != null, in which case I should alloc a block and read
directly into it.  That would avoid one copy of the data.

-- 
Shawn.
--
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]

  Powered by Linux