X-Received: by 10.66.84.97 with SMTP id x1mr1858407pay.7.1358584972672; Sat, 19 Jan 2013 00:42:52 -0800 (PST) X-Received: by 10.50.5.174 with SMTP id t14mr1511204igt.11.1358584972438; Sat, 19 Jan 2013 00:42:52 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!newsfeed.news.ucla.edu!usenet.stanford.edu!f6no10579563pbd.1!news-out.google.com!s9ni5515pbb.0!nntp.google.com!f6no10579558pbd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Sat, 19 Jan 2013 00:42:52 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T NNTP-Posting-Host: 173.164.137.214 References: <7ff63461-89b5-4196-8902-ead245eb6945@googlegroups.com> <50f9de01$0$282$14726298@news.sunsite.dk> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <60a15fd6-7cfd-4fe8-a73c-f54022c548dd@googlegroups.com> Subject: Re: StringBuilder for byte[] From: Lew Cc: Roedy Green Injection-Date: Sat, 19 Jan 2013 08:42:52 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.programmer:21574 Roedy Green wrote: > Lew wrote, quoted or indirectly quoted someone who said : >> He said that the task is "to write a StringBuilder or FastCat". > > What I intended was just something to concatenate byte[] into longer > byte[], no encodings involved, not a StringBuilder than squirted out > encoded bytes. It is a subset of what ByteArrayOutputStream does. > > A FastCat is like a StringBuilder but where you estimate the number > fragments to be joined, not the total length of the result. It is more > RAM efficient since it allocates the precise amount of space needed > for the concatenated String. > > see http://mindprod.com/jgloss/stringbuilder.html > > where I discuss the merits of StringBuilder vs FastCat vs StringBuffer I stand corrected. -- Lew