org.clazzes.optional.io
Interface DataCodeable

All Known Implementing Classes:
BigInt

public interface DataCodeable

This interface is implemented by classes which may be serialized to a DataOutput instance and deserialized from a DataInput instance.

By convention, each implementation should provide for a static readDataInstance(DataInput) method, which constructs a new instance from the stream:

 import java.io.DataInput;
 import java.io.DataOutput;
 class MyDataCodeable {
    public static MyDataCodeable readDataInstance(DataInput in) throws IOException {
      // read fields, construct new instance...
    }
    
    public void writeData(DataOutput out) throws IOException {
      // write fields...
    }
 }
 

See Also:
DataCodingHelper

Method Summary
 void writeData(java.io.DataOutput out)
          Write fields of this instance to the given DataOutput instance.
 

Method Detail

writeData

void writeData(java.io.DataOutput out)
               throws java.io.IOException
Write fields of this instance to the given DataOutput instance.

Parameters:
out - The output to write to.
Throws:
java.io.IOException - Upon write errors.


Copyright © 2010. All Rights Reserved.