summaryrefslogtreecommitdiff
path: root/java/io
diff options
context:
space:
mode:
Diffstat (limited to 'java/io')
-rw-r--r--java/io/ObjectInputStream.java18
-rw-r--r--java/io/ObjectStreamConstants.java3
2 files changed, 19 insertions, 2 deletions
diff --git a/java/io/ObjectInputStream.java b/java/io/ObjectInputStream.java
index 771222ad5..18ff95f05 100644
--- a/java/io/ObjectInputStream.java
+++ b/java/io/ObjectInputStream.java
@@ -432,7 +432,23 @@ public class ObjectInputStream extends InputStream
clearHandles();
throw new WriteAbortedException("Exception thrown during writing of stream", e);
}
-
+
+ case TC_ENUM:
+ {
+ /* TC_ENUM classDesc newHandle enumConstantName */
+ if (dump)
+ dumpElementln("ENUM=");
+ ObjectStreamClass osc = (ObjectStreamClass) readObject();
+ String constantName = (String) readObject();
+ if (dump)
+ dumpElementln("CONSTANT NAME = " + constantName);
+ Class clazz = osc.forClass();
+ Enum instance = Enum.valueOf(clazz, constantName);
+ assignNewHandle(instance);
+ ret_val = instance;
+ break;
+ }
+
default:
throw new IOException("Unknown marker on stream: " + marker);
}
diff --git a/java/io/ObjectStreamConstants.java b/java/io/ObjectStreamConstants.java
index 04cf79bed..5bf463d3d 100644
--- a/java/io/ObjectStreamConstants.java
+++ b/java/io/ObjectStreamConstants.java
@@ -87,9 +87,10 @@ public interface ObjectStreamConstants
byte TC_EXCEPTION = (byte)123; //0x7B
byte TC_LONGSTRING = (byte)124; //0x7C
byte TC_PROXYCLASSDESC = (byte)125; //0x7D
+ byte TC_ENUM = (byte)126; //0x7E
byte TC_BASE = TC_NULL;
- byte TC_MAX = TC_PROXYCLASSDESC;
+ byte TC_MAX = TC_ENUM;
int baseWireHandle = 0x7e0000;