Re: RFR: 8197594 - String and character repeat

2018-02-17 Thread Stuart Marks
Fair enough. I'll be less unhappy if there is a way to convert from a code point to a String, as requested by JDK-4993841. This will reduce new String(Character.toChars(codepoint)).repeat(count) to Character.toString(codepoint).repeat(count) But this is still fairly roundabout. Since

Re: [JDK-6341887] Patch: java.util.zip: Add ByteBuffer methods to Inflater/Deflater

2018-02-17 Thread Xueming Shen
On 2/16/18, 2:13 PM, David Lloyd wrote: It would be convenient to be able to inflate/deflate a direct or heap byte buffer without having to copy it through an array first. For my Friday mini-project this week, I've decided to take a crack at this. The attached patch is the result. Would anyone

Re: RFR: 8197594 - String and character repeat

2018-02-17 Thread Brian Goetz
> On Feb 17, 2018, at 9:40 AM, Martin Buchholz wrote: > > Let me join the chorus of agreement with Brian here. > > The most popular use case will forever be ASCII line of non-letter symbols. We may also wish to have a repeating version on StringBuilder, though:

Re: RFR: 8197594 - String and character repeat

2018-02-17 Thread Martin Buchholz
Let me join the chorus of agreement with Brian here. The most popular use case will forever be ASCII line of non-letter symbols. Another way to think about codepoints is as conversion between UTF-32 and UTF-16, or as general support for text in UTF-32 format, which is not supported well within

Re: RFR: JDK-8021560,(str) String constructors that take ByteBuffer

2018-02-17 Thread Robert Muir
On Sat, Feb 17, 2018 at 4:05 AM, Alan Bateman wrote: > Just to add that the existing low-level / advanced API for this is > CharsetEncoder. The CoderResult from an encode and the buffer positions > means you know when there is overflow, the number of characters encoded,

Re: RFR: 8197594 - String and character repeat

2018-02-17 Thread Remi Forax
- Mail original - > De: "Brian Goetz" > À: "Xueming Shen" > Cc: "core-libs-dev" > Envoyé: Samedi 17 Février 2018 03:30:10 > Objet: Re: RFR: 8197594 - String and character repeat > I really can’t see the

Re: RFR: JDK-8021560,(str) String constructors that take ByteBuffer

2018-02-17 Thread Alan Bateman
On 16/02/2018 22:55, Richard Warburton wrote: : I think some of the context here around application level memory management of the byte buffers is missing. The getBytes() methods were supposed to be useful in scenarios where you have a String and you want to write the byte encoded version of it