Code example for ObjectInput

Methods: readFullyreadInt

0
        this.dataPkg = null;
    } 
 
    @Override 
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        int length = in.readInt();
        byte[] message = new byte[length];
        in.readFully(message);
        getMember(message,this);
 
    } 
 
    @Override 
    public void writeExternal(ObjectOutput out) throws IOException {
        byte[] data = this.getData();
        out.writeInt(data.length);
        out.write(data);
    } 
 
}