-
Bug
-
Resolution: Fixed
-
P2
-
1.2.0, 1.3.0
-
kestrel
-
generic, sparc
-
generic, solaris_2.6
Name: dbT83986 Date: 03/15/99
When String's getBytes() method is called repeatedly
with the same string, the byte arrary returned by
this method is different on subsequent calls.
Given:
String s = new String("a");
String encoding = "UnicodeBig";
byte [] b = null;
When the following is execute, the length of array b is 4
(the first two bytes contain the FE and FF):
b = s.getBytes(encoding);
System.out.println("LEN = " + b.length);
If the above two lines are re-executed, the length of
array b is two (the FE and FF bytes are NOT present):
b = s.getBytes(encoding);
System.out.println("LEN = " + b.length);
(Review ID: 55461)
======================================================================
- duplicates
-
JDK-4230515 Unicode encoding/decoding fails on 2nd invocation
-
- Closed
-