Code example for ObjectOutput

Methods: writeByte, writeChars, writeInt

0
	public Symbol getSymbol(String s) {
	    return valueOf(s);
	} 
 
	public void writeExternal(ObjectOutput out) throws IOException {
	    out.writeInt(description.length());
	    out.writeChars(description);
	    out.writeByte(byteValue);
	} 
 
	public void readExternal(ObjectInput in) throws IOException,
		ClassNotFoundException { 
	    char[] charDescription = new char[in.readInt()];
	    for (int i = 0; i < charDescription.length; i++) {
		charDescription[i] = in.readChar();
	    } 
	    description = String.copyValueOf(charDescription);
	    byteValue = in.readByte();
 
	}