Class Arrays


  • public final class Arrays
    extends java.lang.Object
    General array utilities.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Arrays()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] copyOfRange​(byte[] data, int from, int to)
      Make a copy of a range of bytes from the passed in data array.
      private static int getLength​(int from, int to)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Arrays

        private Arrays()
    • Method Detail

      • copyOfRange

        public static byte[] copyOfRange​(byte[] data,
                                         int from,
                                         int to)
        Make a copy of a range of bytes from the passed in data array. The range can extend beyond the end of the input array, in which case the return array will be padded with zeroes.
        Parameters:
        data - the array from which the data is to be copied.
        from - the start index at which the copying should take place.
        to - the final index of the range (exclusive).
        Returns:
        a new byte array containing the range given.
      • getLength

        private static int getLength​(int from,
                                     int to)