Code example for ObjectInput

Methods: readInt, readUTF

0
	} 
 
	@Override 
	public void readExternal(ObjectInput in) throws IOException,
			ClassNotFoundException { 
		this.name = in.readUTF();
		this.numberOfPages = in.readInt();
	} 
 
	@Override 
	public void writeExternal(ObjectOutput out) throws IOException {
		out.writeUTF(name);
		out.writeInt(numberOfPages);
	} 
 
	public int getNumberOfPages() { 
		return numberOfPages;
	} 
 
	public void setNumberOfPages(int numberOfPages) {
		this.numberOfPages = numberOfPages;