-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
1.1, 1.1.2
-
generic, x86, sparc
-
generic, solaris_2.5.1, windows_95, windows_nt
Name: el35337 Date: 01/13/97
Please compile this source and run.
---- source --------------------------------------------------------
import java.io.*;
Please compile this source and run.
---- source --------------------------------------------------------
import java.io.*;
public class SerializeTest
{
// static int size = 65535; // <-- OK
static int size = 65536; // <-- NG
public static void main(String[] args)
{
try
{
StringBuffer sb = new StringBuffer();
String in;
String out;
File objfile = new File("test.obj");
File txtfile = new File("test.txt");
for(int i=0;i<size;i++)
sb.append('a');
out = sb.toString();
ObjectOutputStream os =
new ObjectOutputStream(new FileOutputStream(objfile));
os.writeObject(out);
os.flush();
os.close();
System.err.println("write: " + out.length() + " chars.");
ObjectInputStream is =
new ObjectInputStream(new FileInputStream(objfile));
in = (String)is.readObject();
is.close();
System.err.println("read: " + in.length() + " chars.");
FileOutputStream f = new FileOutputStream(txtfile);
f.write(in.getBytes());
f.flush();
f.close();
}
catch (Exception e)
{
System.err.println(e.getMessage());
e.printStackTrace(System.err);
}
}
}
---- end of source --------------------------------------------------
Fujitsu fujitsu!fb.se.fujitsu.co.jp!###@###.###
======================================================================
- duplicates
-
JDK-4039553 Serialization of large strings fail
-
- Closed
-
- relates to
-
JDK-4026823 writeUTF OutputStream doesn't throw an exception when encoding > 65536
-
- Closed
-
-
JDK-4128333 Data{Input,Output}Stream UTF strings restricted to 65536 encoded bytes
-
- Open
-