Class IOUtils
java.lang.Object
com.igormaznitsa.meta.common.utils.IOUtils
Auxiliary methods for IO operations.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Closeable
closeQuetly
(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.
-
Constructor Details
-
IOUtils
private IOUtils()
-
-
Method Details
-
packData
Pack some binary data.- Parameters:
data
- data to be packed- Returns:
- packed data as byte array
- Since:
- 1.0
-
unpackData
Unpack binary data packed by the packData method.- Parameters:
data
- packed data array- Returns:
- unpacked byte array
- Throws:
IllegalArgumentException
- it will be thrown if the data has wrong format, global error listeners will be also notified- Since:
- 1.0
- See Also:
-
closeQuetly
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
-