Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #21527
| From | Sven Köhler <remove-sven.koehler@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: StringBuilder for byte[] |
| Date | 2013-01-18 18:08 +0100 |
| Message-ID | <altdruFdqh6U1@mid.dfncis.de> (permalink) |
| References | <ti2if89pi9o6fcd32b739prbocff6i9plp@4ax.com> <alsp4iF91cjU1@mid.dfncis.de> <7ff63461-89b5-4196-8902-ead245eb6945@googlegroups.com> |
Am 18.01.2013 17:54, schrieb Lew: > Sven Köhler wrote: >> Roedy Green: >>> It would be a fairly simple task to write a StringBuilder or FastCat >>> that worked with byte[]. I wonder if such a beast exists already, or >>> if there would be much use for it. >> >> ByteArrayOutputStream exists. Its write() method would be the equivalent >> of StringBuilder.append(). > > Actually, not quite. The former needs a Writer to handle encoding. Oh I see. You interpreted the question completely different. I was assuming, that the input was bytes, not characters. But anyway: wouldn't ByteArrayOutputStream + OutputStreamWriter be exactly the right thing if the input was characters? > A better choice would be > http://docs.oracle.com/javase/7/docs/api/java/io/CharArrayWriter.html It works with char[] internally. The question was about something that works with byte[] internally, I believe. Not sure, what that is good for though. Regards, Sven
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
StringBuilder for byte[] Roedy Green <see_website@mindprod.com.invalid> - 2013-01-18 00:40 -0800
Re: StringBuilder for byte[] Sven Köhler <remove-sven.koehler@gmail.com> - 2013-01-18 12:15 +0100
Re: StringBuilder for byte[] Lew <lewbloch@gmail.com> - 2013-01-18 08:54 -0800
Re: StringBuilder for byte[] Sven Köhler <remove-sven.koehler@gmail.com> - 2013-01-18 18:08 +0100
Re: StringBuilder for byte[] Arne Vajhøj <arne@vajhoej.dk> - 2013-01-18 18:42 -0500
Re: StringBuilder for byte[] Lew <lewbloch@gmail.com> - 2013-01-18 17:07 -0800
Re: StringBuilder for byte[] Arne Vajhøj <arne@vajhoej.dk> - 2013-01-18 20:27 -0500
Re: StringBuilder for byte[] Arne Vajhøj <arne@vajhoej.dk> - 2013-01-18 20:28 -0500
Re: StringBuilder for byte[] Roedy Green <see_website@mindprod.com.invalid> - 2013-01-18 23:21 -0800
Re: StringBuilder for byte[] Lew <lewbloch@gmail.com> - 2013-01-19 00:42 -0800
Re: StringBuilder for byte[] Roedy Green <see_website@mindprod.com.invalid> - 2013-01-20 00:48 -0800
Re: StringBuilder for byte[] Arne Vajhøj <arne@vajhoej.dk> - 2013-01-18 18:44 -0500
csiph-web