mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
ObjectInputStream: handle fields of type String
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
48e0912ad4
commit
bba0d25ba5
@ -278,7 +278,20 @@ public class ObjectInputStream extends InputStream implements DataInput {
|
||||
}
|
||||
|
||||
public Object readObject() throws IOException, ClassNotFoundException {
|
||||
expectToken(TC_OBJECT);
|
||||
int c = rawByte();
|
||||
if (c == TC_NULL) {
|
||||
return null;
|
||||
}
|
||||
if (c == TC_STRING) {
|
||||
int length = rawShort();
|
||||
byte[] bytes = new byte[length];
|
||||
readFully(bytes);
|
||||
return new String(bytes, "UTF-8");
|
||||
}
|
||||
if (c != TC_OBJECT) {
|
||||
throw new IOException("Unexpected token: 0x"
|
||||
+ Integer.toHexString(c));
|
||||
}
|
||||
|
||||
// class desc
|
||||
expectToken(TC_CLASSDESC);
|
||||
|
Loading…
Reference in New Issue
Block a user