Java Integer Create toIntExact(long value)

Here you can find the source of toIntExact(long value)

Description

to Int Exact

License

Open Source License

Declaration

public static int toIntExact(long value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int toIntExact(long value) {
        if ((int) value != value) {
            throw new ArithmeticException("integer overflow");
        }//from w  w  w. j a v a  2  s.c  o  m
        return (int) value;
    }
}

Related

  1. toInternalString(String s)
  2. toInternalValue(final double value)
  3. toInternalVariableName(String varName)
  4. toInternLink(String title, String url)
  5. toInterval(long i)
  6. toIntExp(String charExp)
  7. toIntFormat(String value)
  8. toIntHeader(String value)
  9. toIntLE(byte[] value)