412 |
|
|
413 |
protected void writeClassDescriptor(ObjectStreamClass osc) throws IOException |
protected void writeClassDescriptor(ObjectStreamClass osc) throws IOException |
414 |
{ |
{ |
415 |
realOutput.writeByte(TC_CLASSDESC); |
if (osc.isProxyClass) |
|
realOutput.writeUTF(osc.getName()); |
|
|
realOutput.writeLong(osc.getSerialVersionUID()); |
|
|
assignNewHandle(osc); |
|
|
|
|
|
int flags = osc.getFlags(); |
|
|
|
|
|
if (protocolVersion == PROTOCOL_VERSION_2 |
|
|
&& osc.isExternalizable()) |
|
|
flags |= SC_BLOCK_DATA; |
|
|
|
|
|
realOutput.writeByte(flags); |
|
|
|
|
|
ObjectStreamField[] fields = osc.fields; |
|
|
realOutput.writeShort(fields.length); |
|
|
|
|
|
ObjectStreamField field; |
|
|
for (int i = 0; i < fields.length; i++) |
|
416 |
{ |
{ |
417 |
field = fields[i]; |
realOutput.writeByte(TC_PROXYCLASSDESC); |
418 |
realOutput.writeByte(field.getTypeCode ()); |
Class[] intfs = osc.forClass().getInterfaces(); |
419 |
realOutput.writeUTF(field.getName ()); |
realOutput.writeInt(intfs.length); |
420 |
|
for (int i = 0; i < intfs.length; i++) |
421 |
if (! field.isPrimitive()) |
realOutput.writeUTF(intfs[i].getName()); |
422 |
writeObject(field.getTypeString()); |
|
423 |
|
boolean oldmode = setBlockDataMode(true); |
424 |
|
annotateProxyClass(osc.forClass()); |
425 |
|
setBlockDataMode(oldmode); |
426 |
|
realOutput.writeByte(TC_ENDBLOCKDATA); |
427 |
|
} |
428 |
|
else |
429 |
|
{ |
430 |
|
realOutput.writeByte(TC_CLASSDESC); |
431 |
|
realOutput.writeUTF(osc.getName()); |
432 |
|
realOutput.writeLong(osc.getSerialVersionUID()); |
433 |
|
assignNewHandle(osc); |
434 |
|
|
435 |
|
int flags = osc.getFlags(); |
436 |
|
|
437 |
|
if (protocolVersion == PROTOCOL_VERSION_2 |
438 |
|
&& osc.isExternalizable()) |
439 |
|
flags |= SC_BLOCK_DATA; |
440 |
|
|
441 |
|
realOutput.writeByte(flags); |
442 |
|
|
443 |
|
ObjectStreamField[] fields = osc.fields; |
444 |
|
realOutput.writeShort(fields.length); |
445 |
|
|
446 |
|
ObjectStreamField field; |
447 |
|
for (int i = 0; i < fields.length; i++) |
448 |
|
{ |
449 |
|
field = fields[i]; |
450 |
|
realOutput.writeByte(field.getTypeCode ()); |
451 |
|
realOutput.writeUTF(field.getName ()); |
452 |
|
|
453 |
|
if (! field.isPrimitive()) |
454 |
|
writeObject(field.getTypeString()); |
455 |
|
} |
456 |
|
|
457 |
|
boolean oldmode = setBlockDataMode(true); |
458 |
|
annotateClass(osc.forClass()); |
459 |
|
setBlockDataMode(oldmode); |
460 |
|
realOutput.writeByte(TC_ENDBLOCKDATA); |
461 |
} |
} |
|
|
|
|
boolean oldmode = setBlockDataMode(true); |
|
|
annotateClass(osc.forClass()); |
|
|
setBlockDataMode(oldmode); |
|
|
realOutput.writeByte(TC_ENDBLOCKDATA); |
|
462 |
|
|
463 |
if (osc.isSerializable() || osc.isExternalizable()) |
if (osc.isSerializable() || osc.isExternalizable()) |
464 |
writeObject(osc.getSuper()); |
writeObject(osc.getSuper()); |