Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4147390
Votes 0
Synopsis java.io.DataInputStream.readUTF should avoid copying char[] data
Category java:classes_io
Reported Against 1.2beta4
Release Fixed
State 11-Closed, duplicate of 4219771, request for enhancement
Priority: 4-Low
Related Bugs 4219771
Submit Date 10-JUN-1998
Description
DataInputStream.readUTF is using a public String constructor, which forces the char array to always be reallocated and copied.  It is frequently the case that the char array created by readUTF will be of exactly the right length, and could be used as-is, without copying, if only there was a privilged way for it to create a String.

In an RMI server that I have, which involves serialization via RMI and then serialization to a file for  customer  storage, over 4Kb of heap is allocated and then discarded by readUTF per single RMI call to the server.  It would be very beneficial to eliminate this overhead.
Work Around
None.
Evaluation
N/A
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang