1693 impl = tmp;
1694 } catch (Exception e) {
1695 throw new Error("System property impl.prefix incorrect");
1696 }
1697 }
1698
1699 return (InetAddressImpl) impl;
1700 }
1701
1702 private void readObjectNoData (ObjectInputStream s) throws
1703 IOException, ClassNotFoundException {
1704 if (getClass().getClassLoader() != null) {
1705 throw new SecurityException ("invalid address type");
1706 }
1707 }
1708
1709 private static final long FIELDS_OFFSET;
1710 private static final jdk.internal.misc.Unsafe UNSAFE;
1711
1712 static {
1713 try {
1714 jdk.internal.misc.Unsafe unsafe = jdk.internal.misc.Unsafe.getUnsafe();
1715 FIELDS_OFFSET = unsafe.objectFieldOffset(
1716 InetAddress.class.getDeclaredField("holder")
1717 );
1718 UNSAFE = unsafe;
1719 } catch (ReflectiveOperationException e) {
1720 throw new Error(e);
1721 }
1722 }
1723
1724 private void readObject (ObjectInputStream s) throws
1725 IOException, ClassNotFoundException {
1726 if (getClass().getClassLoader() != null) {
1727 throw new SecurityException ("invalid address type");
1728 }
1729 GetField gf = s.readFields();
1730 String host = (String)gf.get("hostName", null);
1731 int address= gf.get("address", 0);
1732 int family= gf.get("family", 0);
1733 InetAddressHolder h = new InetAddressHolder(host, address, family);
1734 UNSAFE.putObject(this, FIELDS_OFFSET, h);
1735 }
1736
1737 /* needed because the serializable fields no longer exist */
1738
1739 /**
1740 * @serialField hostName String
1741 * @serialField address int
|
1693 impl = tmp;
1694 } catch (Exception e) {
1695 throw new Error("System property impl.prefix incorrect");
1696 }
1697 }
1698
1699 return (InetAddressImpl) impl;
1700 }
1701
1702 private void readObjectNoData (ObjectInputStream s) throws
1703 IOException, ClassNotFoundException {
1704 if (getClass().getClassLoader() != null) {
1705 throw new SecurityException ("invalid address type");
1706 }
1707 }
1708
1709 private static final long FIELDS_OFFSET;
1710 private static final jdk.internal.misc.Unsafe UNSAFE;
1711
1712 static {
1713 jdk.internal.misc.Unsafe unsafe = jdk.internal.misc.Unsafe.getUnsafe();
1714 FIELDS_OFFSET = unsafe.objectFieldOffset(InetAddress.class, "holder");
1715 UNSAFE = unsafe;
1716 }
1717
1718 private void readObject (ObjectInputStream s) throws
1719 IOException, ClassNotFoundException {
1720 if (getClass().getClassLoader() != null) {
1721 throw new SecurityException ("invalid address type");
1722 }
1723 GetField gf = s.readFields();
1724 String host = (String)gf.get("hostName", null);
1725 int address= gf.get("address", 0);
1726 int family= gf.get("family", 0);
1727 InetAddressHolder h = new InetAddressHolder(host, address, family);
1728 UNSAFE.putObject(this, FIELDS_OFFSET, h);
1729 }
1730
1731 /* needed because the serializable fields no longer exist */
1732
1733 /**
1734 * @serialField hostName String
1735 * @serialField address int
|