public void writeExternal(ObjectOutput out) throws IOException { if ( accessType != null ) { out.writeBoolean( true ); out.writeUTF( accessType.toString() ); } else { out.writeBoolean( false ); } if ( type != null ) { out.writeBoolean( true ); out.writeUTF( type ); } else { out.writeBoolean( false ); } if ( content != null ) { out.writeBoolean( true ); out.writeInt( content.length ); out.write( content ); } else { out.writeBoolean( false ); } }
public void writeExternal(ObjectOutput out) throws IOException { out.writeLong( id ); if( name == null ) { name = ""; } out.writeUTF( name ); out.writeUTF( accessType.toString() ); if( contentType == null ) { contentType = ""; } out.writeUTF( contentType ); // There are no guarantees that attachedBy is not null == potential bug attachedBy.writeExternal( out ); long attachedAtTime = 0; if( attachedAt != null ) { attachedAtTime = attachedAt.getTime(); } out.writeLong( attachedAtTime ); out.writeInt( size ); out.writeLong( attachmentContentId ); }
public void writeExternal(ObjectOutput out) throws IOException { if ( accessType != null ) { out.writeBoolean( true ); out.writeUTF( accessType.toString() ); } else { out.writeBoolean( false ); } if ( type != null ) { out.writeBoolean( true ); out.writeUTF( type ); } else { out.writeBoolean( false ); } if ( content != null ) { out.writeBoolean( true ); out.writeInt( content.length ); out.write( content ); } else { out.writeBoolean( false ); } }
public void writeExternal(ObjectOutput out) throws IOException { out.writeLong( id ); if( name == null ) { name = ""; } out.writeUTF( name ); out.writeUTF( accessType.toString() ); if( contentType == null ) { contentType = ""; } out.writeUTF( contentType ); // There are no guarantees that attachedBy is not null == potential bug attachedBy.writeExternal( out ); long attachedAtTime = 0; if( attachedAt != null ) { attachedAtTime = attachedAt.getTime(); } out.writeLong( attachedAtTime ); out.writeInt( size ); out.writeLong( attachmentContentId ); }