class IntegerType extends AbstractDERType implements DEREncoder {

  public static int decodeUnsignedPrimitive(final DERBuffer encoded)
  {
    // CheckStyle:MagicNumber OFF
    final byte[] bytes = encoded.getRemainingBytes();
    if (bytes.length > 4) {
      throw new IllegalArgumentException("Buffer length must be <= 4 bytes");
    }
    int i = 0;
    for (byte b : bytes) {
      i <<= 8;
      i |= b & 0xFF;
    }
    return i;
    // CheckStyle:MagicNumber ON
  }

  public  IntegerType(final BigInteger item);
  public  IntegerType(final int item);
  public  IntegerType(final DERTag tag, final BigInteger item);
  public  IntegerType(final DERTag tag, final int item);

}