com.ibm.storage.clientlibrary

Class Util



  • public class Util
    extends Object
    Author:
    ArunIyengar
    • Constructor Detail

      • Util

        public Util()
    • Method Detail

      • uncheckedCast

        public static <T> T uncheckedCast(Object obj)
        Perform an unchecked cast while suppressing warnings
        Type Parameters:
        T - type of cast object
        Parameters:
        obj - object to be cached
        Returns:
        cast object
      • compress

        public static byte[] compress(Serializable object)
        compress a serializable object using gzip
        Parameters:
        object - object which implements Serializable
        Returns:
        byte array containing compressed objects
      • decompress

        public static <T> T decompress(byte[] bytes)
        Decompress a compressed object
        Type Parameters:
        T - type of decompressed object
        Parameters:
        bytes - byte array corresponding to compressed object
        Returns:
        decompressed object
      • describeException

        public static void describeException(Exception e,
                                             String message)
        Output information about an exception
        Parameters:
        e - The exception
        message - Message to output
      • getTime

        public static long getTime()
        Return the current time
        Returns:
        Milliseconds since January 1, 1970

Copyright © 2015. All rights reserved.