RFR (S) 8222491: jcmd can fail converting UTF8 output to strings

Schmelter, Ralf ralf.schmelter at sap.com
Tue Apr 16 09:06:35 UTC 2019


Hi David,

of course you could just copy the bytes to System.out, but that would not respect the platforms character encoding. 

And since the PrintWriter of System.out has no write(char[], int, int) method, it is probably easier to just convert to a string. At least I've not found a convenience method to pipe a Reader to a PrintWriter using the char[] based methods.

Best regards,
Ralf

-----Original Message-----
From: David Holmes <david.holmes at oracle.com> 
Sent: Dienstag, 16. April 2019 08:41
To: Langer, Christoph <christoph.langer at sap.com>; Schmelter, Ralf <ralf.schmelter at sap.com>; serviceability-dev at openjdk.java.net
Subject: Re: RFR (S) 8222491: jcmd can fail converting UTF8 output to strings

Hi Ralf, Christoph,

On 16/04/2019 3:54 pm, Langer, Christoph wrote:
> Hi Ralf,
> 
> looks good, thanks for fixing this. I can push it for you.
> 
> Can we please get another Reviewer's review? ��

Well I agree that the fix addresses the problem that has been described.

But I can't help but think there has to be a simpler way to pipe one 
inputstream into an outputstream without all the intermediary steps - ie 
creating strings. ??

Cheers,
David


More information about the serviceability-dev mailing list