protected ObjectStreamClass readClassDescriptor ( ) throws IOException , ClassNotFoundException { ObjectStreamClass newClassDesc = new ObjectStreamClass ( ) ; String name = input . readUTF ( ) ; if ( name . length ( ) == 0 ) { throw new IOException ( "The stream is corrupted" ) ; } newClassDesc . setName ( name ) ; newClassDesc . setSerialVersionUID ( input . readLong ( ) ) ; newClassDesc . setFlags ( input . readByte ( ) ) ; /* * We must register the class descriptor before reading field * descriptors. If called outside of readObject, the descriptorHandle * might be unset. */ if ( descriptorHandle == - 1 ) { descriptorHandle = nextHandle ( ) ; } registerObjectRead ( newClassDesc , descriptorHandle , false ) ; readFieldDescriptors ( newClassDesc ) ; return newClassDesc ; }
Reads a class descriptor from the source stream .