Name: rmT116609 Date: 02/25/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Several places in the SDK have code which uses the deprecated String(byte[] ascii, int hibyte, int offset, int count) constructor which is then appended to a StringBuffer. Obviously the String(byte[] bytes, int offset, int length, String charsetName) constructor could be used. However adding a new
append() method to StringBuffer would avoid unnecessary copies
to StringBuffer add
public StringBuffer append(byte[] bytes, int offset, int length, String charsetName)
CUSTOMER WORKAROUND :
use
byte[] bytes = ...
StringBuffer sb = new StringBuffer();
String str = new String(bytes, 0, bytes.length, null);
sb.append(str);
(Review ID: 143308)
======================================================================
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Several places in the SDK have code which uses the deprecated String(byte[] ascii, int hibyte, int offset, int count) constructor which is then appended to a StringBuffer. Obviously the String(byte[] bytes, int offset, int length, String charsetName) constructor could be used. However adding a new
append() method to StringBuffer would avoid unnecessary copies
to StringBuffer add
public StringBuffer append(byte[] bytes, int offset, int length, String charsetName)
CUSTOMER WORKAROUND :
use
byte[] bytes = ...
StringBuffer sb = new StringBuffer();
String str = new String(bytes, 0, bytes.length, null);
sb.append(str);
(Review ID: 143308)
======================================================================