From 5f69d8ab05ddfa87426e7eca10f68bbb7d907641 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 3 Nov 2002 20:27:31 +0000 Subject: GNU Classpath merge. 2002-10-31 Stephen Crawley * java/lang/Double.java (valueOf): Return new Double(parseDouble(s)). 2002-10-31 Wu Gansha : * java/util/ArrayList.java (readObject, writeObject): Only read/write size items. 2002-10-31 Wu Gansha : * java/io/DataInputStream.java (convertFromUTF): Give StringBuffer an initial estimated size to avoid enlarge buffer frequently. 2002-10-31 Wu Gansha : * java/lang/reflect/Proxy.java (ProxyType): Set loader to System ClassLoader when null. (ProxyType.hashCode): Loader null check no longer needed. (ProxyType.sameTypes): New method. (ProxyType.equals): Use new method. 2002-10-31 Mark Wielaard * java/net/URLDecoder.java (decode): Initialize Stringbuffer size to length of String. * java/net/URLEncoder.java (encode): Likewise. 2002-10-31 Mark Wielaard * java/util/zip/ZipInputStream.java (getNextEntry): Throw IOException when stream is closed. (closeEntry): Likewise. (read): Likewise. * java/util/zip/ZipOutputStream.java (putNextEntry): Throw ZipException when no entry active. (closeEntry): Likewise. (write): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58772 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/io/DataInputStream.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libjava/java/io') diff --git a/libjava/java/io/DataInputStream.java b/libjava/java/io/DataInputStream.java index 1223e3e7fe5..52c0c7a7b82 100644 --- a/libjava/java/io/DataInputStream.java +++ b/libjava/java/io/DataInputStream.java @@ -734,7 +734,9 @@ public class DataInputStream extends FilterInputStream implements DataInput static String convertFromUTF(byte[] buf) throws EOFException, UTFDataFormatException { - StringBuffer strbuf = new StringBuffer(); + // Give StringBuffer an initial estimated size to avoid + // enlarge buffer frequently + StringBuffer strbuf = new StringBuffer(buf.length/2 + 2); for (int i = 0; i < buf.length; ) { -- cgit v1.2.3