Class IOUtils


  • public final class IOUtils
    extends java.lang.Object
    Auxiliary methods for IO operations.
    Since:
    1.0
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private IOUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.Closeable closeQuetly​(java.io.Closeable closeable)
      Closing quetly any closeable object.
      static byte[] packData​(byte[] data)
      Pack some binary data.
      static byte[] unpackData​(byte[] data)
      Unpack binary data packed by the packData method.
      • Methods inherited from class java.lang.Object

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

      • IOUtils

        private IOUtils()
    • Method Detail

      • packData

        @Weight(VARIABLE)
        public static byte[] packData​(byte[] data)
        Pack some binary data.
        Parameters:
        data - data to be packed
        Returns:
        packed data as byte array
        Since:
        1.0
      • unpackData

        @Weight(VARIABLE)
        public static byte[] unpackData​(byte[] data)
        Unpack binary data packed by the packData method.
        Parameters:
        data - packed data array
        Returns:
        unpacked byte array
        Throws:
        java.lang.IllegalArgumentException - it will be thrown if the data has wrong format, global error listeners will be also notified
        Since:
        1.0
        See Also:
        packData(byte[])
      • closeQuetly

        @Weight(LIGHT)
        public static java.io.Closeable closeQuetly​(java.io.Closeable closeable)
        Closing quetly any closeable object. Any exception will be caught (but global error listeners will be notified)
        Parameters:
        closeable - object to be closed quetly
        Returns:
        the same object provided in args
        Since:
        1.0