Code example for ObjectInput

Methods: read, readInt

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