if(in.readByte() == 1) { len=in.readInt(); byte[] additional_data=new byte[len]; in.readFully(additional_data, 0, len); ((IpAddress)src_addr).setAdditionalData(additional_data); }
    public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {        int len, leading;        String hdr_name;        Header hdr;        // 1. read the leading byte first        leading=in.readByte();        // 1. dest_addr        if((leading & DEST_SET) == DEST_SET) {            if((leading & IPADDR_DEST) == IPADDR_DEST) {                dest_addr=new IpAddress();                dest_addr.readFrom(in);            }            else {                dest_addr=Util.readAddress(in);            }        }        // 2. src_addr        if((leading & SRC_SET) == SRC_SET) {            if((leading & IPADDR_SRC) == IPADDR_SRC) {                if((leading & SRC_HOST_NULL) == SRC_HOST_NULL) {                    int src_port=in.readInt();                    src_addr=new IpAddress(src_port, false); // keep a null host part                }                else {                    src_addr=new IpAddress();                    src_addr.readFrom(in);                }            }            else {                src_addr=Util.readAddress(in);            }        }        // 3. buf        if((leading & BUF_SET) == BUF_SET) {            len=in.readInt();            buf=new byte[len];            in.read(buf, 0, len);            length=len;        }        // 4. headers        if((leading & HDRS_SET) == HDRS_SET) {            len=in.readInt();            headers(len);            for(int i=0; i < len; i++) {                hdr_name=in.readUTF();                hdr=readHeader(in);                headers.put(hdr_name, hdr);            }        }    }