public class IOUtil
extends java.lang.Object
| Constructor and Description |
|---|
IOUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
asHexString(byte[] bytes)
Convert a byte array into a hexadecimal string
|
static void |
copy(java.io.InputStream input,
java.io.OutputStream output)
Copy the content of specified InputStream into the specified OutputStream
|
static long |
crc32(java.lang.String content)
Calculate a CRC32 for the specified String
|
static java.lang.String |
hashForObjects(java.lang.Object... args)
Generate a predictable (deterministic) hash string of length 8 for an array of objects
|
static java.lang.String |
randomHexString()
Generate a random 8 character string of hexadecimal digits
|
static java.lang.String |
randomHexString(int length)
Generate a random string of hexadecimal digits of the specified length
|
public static void copy(java.io.InputStream input,
java.io.OutputStream output)
throws java.io.IOException
input - The input stream to read fromoutput - The output stream to write tojava.io.IOException - an exception if the copy operation failspublic static java.lang.String randomHexString()
public static java.lang.String randomHexString(int length)
length - The length of the resulting stringpublic static java.lang.String asHexString(byte[] bytes)
bytes - A byte arraypublic static java.lang.String hashForObjects(java.lang.Object... args)
args - The objects to take as input for the calculationpublic static long crc32(java.lang.String content)
content - The input stringCopyright © 2023. All rights reserved.