Code example for ObjectOutput

Methods: write, writeInt

0
     * @see java.io.Externalizable#writeExternal 
     * @param out ObjectOutput 
     * @throws IOException 
     */ 
    @Override 
    public void writeExternal(ObjectOutput out) throws IOException {
        out.writeInt(message!=null?message.length:0);
        if ( message!=null ) out.write(message,0,message.length);
    } 
 
}