Code example for ObjectInput

Methods: readInt, readObject, readUTF, readUnsignedByte

0
    public static Endpoint readExternal(ObjectInput in, boolean readCsf)
            throws IOException, ClassNotFoundException { 
        int inCsf = NULL_CSF;
 
        if (readCsf) {
            inCsf = in.readUnsignedByte();
        } 
        String host = (String) in.readUTF();
        int port = in.readInt();
        RMIClientSocketFactory csf = null;
 
        if (readCsf && inCsf == NONNULL_CSF) {
            csf = (RMIClientSocketFactory) in.readObject();
        } 
        return new Endpoint(host, port, csf, null);
    } 
 
    /** 
     * Returns string representation of this Endpoint. 
     * 
     * @return string representation of this Endpoint