Package ru.bgcrm.util.inet

# Class IpNet

java.lang.Object
ru.bgcrm.util.inet.IpNet

public class IpNet extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `mask`
  `protected byte[]`
  `subnet`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IpNet()`
  `IpNet(byte[] subnet, int mask)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getMask()`
  `static int`
  `getMask(byte[] addrFrom, byte[] addrTo)`
  `byte[]`
  `getMaxIp()`
  `byte[]`
  `getSubnet()`
  `boolean`
  `inNet(byte[] address)`
  `static boolean`
  `inNet(byte[] address, byte[] subnet, int mask)`
  `static int`
  `maskToInt(byte[] mask)`
  `static IpNet`
  `newInstance(byte[] addressFrom, byte[] addressTo)`
  Создание новой подсети из правильного диапазона.
  `void`
  `setMask(int mask)`
  `void`
  `setSubnet(byte[] subnet)`
  `String`
  `toString()`
  `static String`
  `toString(byte[] addressFrom, byte[] addressTo)`
  Возвращает строковое представление подсети.
  `static String`
  `toString(byte[] subnet, int mask)`
  Возвращает строковое представление подсети.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### subnet

    protected byte[] subnet

  - ### mask

    protected int mask

- ## Constructor Details

  - ### IpNet

    public IpNet()

  - ### IpNet

    public IpNet(byte[] subnet, int mask)

- ## Method Details

  - ### getSubnet

    public byte[] getSubnet()

  - ### setSubnet

    public void setSubnet(byte[] subnet)

  - ### getMask

    public int getMask()

  - ### setMask

    public void setMask(int mask)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### toString

    public static String toString(byte[] subnet, int mask)
    Возвращает строковое представление подсети.
    Parameters:
      `subnet` -
      `mask` -
    Returns:

  - ### toString

    public static String toString(byte[] addressFrom, byte[] addressTo)
    Возвращает строковое представление подсети.
    Parameters:
      `subnet` -
      `mask` -
    Returns:

  - ### maskToInt

    public static int maskToInt(byte[] mask)

  - ### getMaxIp

    public byte[] getMaxIp()

  - ### getMask

    public static int getMask(byte[] addrFrom, byte[] addrTo)

  - ### newInstance

    public static IpNet newInstance(byte[] addressFrom, byte[] addressTo)
    Создание новой подсети из правильного диапазона.
    Parameters:
      `addressFrom` -
      `addressTo` -
    Returns:

  - ### inNet

    public boolean inNet(byte[] address)

  - ### inNet

    public static boolean inNet(byte[] address, byte[] subnet, int mask)