public ItemState read ( ObjectReader in ) throws UnknownClassIdException , IOException { // read id int key ; if ( ( key = in . readInt ( ) ) != SerializationConstants . ITEM_STATE ) { throw new UnknownClassIdException ( "There is unexpected class [" + key + "]" ) ; } ItemState is = null ; try { int state = in . readInt ( ) ; boolean isPersisted = in . readBoolean ( ) ; boolean eventFire = in . readBoolean ( ) ; QPath oldPath = null ; if ( in . readInt ( ) == SerializationConstants . NOT_NULL_DATA ) { byte [ ] buf = new byte [ in . readInt ( ) ] ; in . readFully ( buf ) ; oldPath = QPath . parse ( new String ( buf , Constants . DEFAULT_ENCODING ) ) ; } boolean isNodeData = in . readBoolean ( ) ; if ( isNodeData ) { PersistedNodeDataReader rdr = new PersistedNodeDataReader ( ) ; is = new ItemState ( rdr . read ( in ) , state , eventFire , null , false , isPersisted , oldPath ) ; } else { PersistedPropertyDataReader rdr = new PersistedPropertyDataReader ( holder , spoolConfig ) ; is = new ItemState ( rdr . read ( in ) , state , eventFire , null , false , isPersisted , oldPath ) ; } return is ; } catch ( EOFException e ) { throw new StreamCorruptedException ( "Unexpected EOF in middle of data block." ) ; } catch ( IllegalPathException e ) { throw new IOException ( "Data corrupted" , e ) ; } }
Read and set ItemState data .