Code example for DataOutput

Methods: writeByte, writeInt, writeLong, writeUTF

0
  /** 
   * Serializes this object. 
   */ 
  public void write(DataOutput out) throws IOException {
//	if(html.length() + String.valueOf(timestamp).length() + Integer.toString(httpStatusCode).length() < 32000){ 
		out.writeByte(version);
	    out.writeInt(httpStatusCode);
	    out.writeLong(timestamp);
	    out.writeUTF(html);
//	}	 
  } 
 
  @Override 
  public HtmlStatus clone() { 
    return new HtmlStatus(httpStatusCode, timestamp, html);
  } 
 
  @Override 
  public String toString() {
    return String.format("[Fetched at %d with status %d:\n%s]\n", timestamp, httpStatusCode, html);
  }