Class Util


  • public class Util
    extends java.lang.Object
    Utility functions, used internally by JPGPJ.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static char[] hexDigits  
    • Constructor Summary

      Constructors 
      Constructor Description
      Util()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int bestFileBufferSize​(long fileSize, int maxFileBufferSize)
      Returns the exact fileSize with a maximum of maxFileBufferSize and a minimum of 1.
      static java.lang.String formatAsHex​(byte[] bytes)
      Formats the specified byte array as a hex string.
      static java.lang.String formatKeyId​(java.lang.Long id)
      Formats the specified key id in the "0xlong" format.
      static boolean isEmpty​(char[] a)
      True if the specified character array is null or empty.
      static boolean isEmpty​(java.lang.String s)
      True if the specified string is null or empty.
      static boolean isEmpty​(java.util.Collection<?> c)
      True if the specified collection is null or empty.
      static boolean isEmpty​(java.util.Map<?,​?> m)
      True if the specified map is null or empty.
      • Methods inherited from class java.lang.Object

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

      • hexDigits

        protected static final char[] hexDigits
    • Constructor Detail

      • Util

        public Util()
    • Method Detail

      • isEmpty

        public static boolean isEmpty​(char[] a)
        True if the specified character array is null or empty.
      • isEmpty

        public static boolean isEmpty​(java.lang.String s)
        True if the specified string is null or empty.
      • isEmpty

        public static boolean isEmpty​(java.util.Collection<?> c)
        True if the specified collection is null or empty.
      • isEmpty

        public static boolean isEmpty​(java.util.Map<?,​?> m)
        True if the specified map is null or empty.
      • formatKeyId

        public static java.lang.String formatKeyId​(java.lang.Long id)
        Formats the specified key id in the "0xlong" format.
      • formatAsHex

        public static java.lang.String formatAsHex​(byte[] bytes)
        Formats the specified byte array as a hex string.
      • bestFileBufferSize

        public static int bestFileBufferSize​(long fileSize,
                                             int maxFileBufferSize)
        Returns the exact fileSize with a maximum of maxFileBufferSize and a minimum of 1.