Class CastUtils

java.lang.Object
org.mp4parser.tools.CastUtils

public class CastUtils extends Object
  • Constructor Details

    • CastUtils

      public CastUtils()
  • Method Details

    • l2i

      public static int l2i(long l)
      Casts a long to an int. In many cases I use a long for a UInt32 but this cannot be used to allocate ByteBuffers or arrays since they restricted to Integer.MAX_VALUE this cast-method will throw a RuntimeException if the cast would cause a loss of information.
      Parameters:
      l - the long value
      Returns:
      the long value as int