public final class IOUtil extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
decodeBase64(String encoded)
Decode base64 input string, return byte array.
|
static String |
decodeBase64AsString(String encoded)
Decode base64 input string, return content as UTF-8 String.
|
static byte[] |
encodeBase64(byte[] value)
Base64 encode value.
|
static byte[] |
encodeBase64(String value)
Base64 encode value.
|
static String |
encodeBase64AsString(byte[] value)
Base64 encode value.
|
static String |
encodeBase64AsString(String value)
Base64 encode value.
|
static byte[] |
readFully(InputStream inputStream)
Read all inputStream content to a byte array.
|
static BufferedImage |
resizeImage(BufferedImage inputImage,
int max)
Resize image to a max width or height image size.
|
static byte[] |
resizeImage(byte[] inputBytes,
int max)
Resize image bytes to a max width or height image size.
|
static void |
write(InputStream inputStream,
OutputStream outputStream)
Write all inputstream content to outputstream.
|
public static void write(InputStream inputStream, OutputStream outputStream) throws IOException
inputStream
- input streamoutputStream
- output streamIOException
- on errorpublic static byte[] decodeBase64(String encoded)
encoded
- Base64 encoded stringpublic static String decodeBase64AsString(String encoded)
encoded
- Base64 encoded stringpublic static String encodeBase64AsString(String value)
value
- input valuepublic static String encodeBase64AsString(byte[] value)
value
- input valuepublic static byte[] encodeBase64(String value)
value
- input valuepublic static byte[] encodeBase64(byte[] value)
value
- input valuepublic static byte[] resizeImage(byte[] inputBytes, int max) throws IOException
inputBytes
- input image bytesmax
- max sizeIOException
- on errorpublic static BufferedImage resizeImage(BufferedImage inputImage, int max)
inputImage
- input imagemax
- max sizepublic static byte[] readFully(InputStream inputStream) throws IOException
inputStream
- input streamIOException
- on errorCopyright © 2001–2024 MickaĆ«l Guessant. All rights reserved.