Code example for ObjectInput

Methods: readLongreadUTF

0
		return _ddmTemplateKey.hashCode() * 11 + _ddmTemplate.hashCode();
	} 
 
	@Override 
	public void readExternal(ObjectInput objectInput) throws IOException {
		long ddmTemplateId = objectInput.readLong();
 
		try { 
			_ddmTemplate = DDMTemplateLocalServiceUtil.getDDMTemplate(
				ddmTemplateId);
		} 
		catch (Exception e) {
			throw new IOException(
				"Unable to retrieve ddm template with ID " + ddmTemplateId, e);
		} 
 
		_ddmTemplateKey = objectInput.readUTF();
	} 
 
	@Override 
	public void writeExternal(ObjectOutput objectOutput) throws IOException {
		objectOutput.writeLong(_ddmTemplate.getTemplateId());