harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "spark shen (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1163) [classlib][luni] Two consecutive java.io.ObjectInputStream.readObject() of enum type will trigger an unspecified StreamCorruptedException
Date Mon, 14 Aug 2006 06:51:15 GMT
[classlib][luni] Two consecutive java.io.ObjectInputStream.readObject() of enum type will trigger
an unspecified StreamCorruptedException
-----------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1163
                 URL: http://issues.apache.org/jira/browse/HARMONY-1163
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: spark shen


Using the enum type below:
static enum EnumFoo {
        a, b,
}

and write the elements of it out :
ByteArrayOutputStream out = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(out);
        oos.writeObject(EnumFoo.a);
        oos.writeObject(EnumFoo.b);
        out.flush();
        out.close();

Then read them in :
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        ObjectInputStream ois = new ObjectInputStream(in);
        Object result = ois.readObject();
        // an unspecified StreamCorruptedException will be thrown out here.
        result = ois.readObject();

        ois.close();

An unspecified StreamCorruptedException will be thrown out.

Best regards
Spark Shen

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message