Class Util

java.lang.Object
org.c02e.jpgpj.util.Util

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

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    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 String
    formatAsHex(byte[] bytes)
    Formats the specified byte array as a hex string.
    static String
    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
    True if the specified string is null or empty.
    static boolean
    True if the specified collection is null or empty.
    static boolean
    isEmpty(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 Details

    • hexDigits

      protected static final char[] hexDigits
  • Constructor Details

    • Util

      public Util()
  • Method Details

    • isEmpty

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

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

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

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

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

      public static 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.