public class ObjectConverterUtil extends Object
Constructor and Description |
---|
ObjectConverterUtil() |
Modifier and Type | Method and Description |
---|---|
static char[] |
bytesToChar(byte[] bytes,
String encoding)
Returns the given bytes as a char array using a given encoding (null means platform default).
|
protected static byte[] |
convertBlobToByteArray(Blob data) |
static byte[] |
convertFileToByteArray(File file)
Returns the contents of the given file as a byte array.
|
static char[] |
convertFileToCharArray(File file,
String encoding)
Returns the contents of the given file as a char array.
|
static String |
convertFileToString(File file)
Returns the contents of the given file as a string.
|
static byte[] |
convertToByteArray(InputStream is) |
static byte[] |
convertToByteArray(InputStream is,
int length)
Returns the given input stream's contents as a byte array.
|
static byte[] |
convertToByteArray(InputStream is,
int length,
boolean close) |
static byte[] |
convertToByteArray(Object data) |
static byte[] |
convertToByteArray(ZipEntry ze,
ZipFile zip)
Returns the contents of the given zip entry as a byte array.
|
static char[] |
convertToCharArray(InputStream stream,
int length,
String encoding)
Returns the given input stream's contents as a character array.
|
static char[] |
convertToCharArray(Reader reader,
int length) |
static InputStream |
convertToInputStream(byte[] data) |
static InputStream |
convertToInputStream(char[] data) |
static InputStream |
convertToInputStream(String data) |
static String |
convertToString(InputStream stream)
Returns the contents of the given InputStream as a string.
|
static String |
convertToString(Reader reader) |
static void |
write(byte[] data,
String fileName) |
static void |
write(char[] data,
String fileName) |
static void |
write(InputStream is,
File f) |
static void |
write(InputStream is,
String fileName) |
static int |
write(OutputStream out,
InputStream is,
byte[] l_buffer,
int length) |
static int |
write(OutputStream out,
InputStream is,
byte[] l_buffer,
int length,
boolean closeBoth) |
static int |
write(OutputStream out,
InputStream is,
byte[] l_buffer,
int length,
boolean closeOutput,
boolean closeInput) |
static int |
write(OutputStream out,
InputStream is,
int length) |
static int |
write(OutputStream out,
InputStream is,
int length,
boolean close) |
static int |
write(OutputStream out,
InputStream is,
int length,
boolean closeOutput,
boolean closeInput) |
static void |
write(Reader reader,
File f) |
static void |
write(Reader reader,
String fileName) |
static int |
write(Writer out,
Reader is,
int length,
boolean close) |
protected static byte[] convertBlobToByteArray(Blob data) throws TeiidException
TeiidException
public static byte[] convertToByteArray(Object data) throws TeiidException, IOException
TeiidException
IOException
public static byte[] convertToByteArray(InputStream is) throws IOException
IOException
public static byte[] convertToByteArray(InputStream is, int length) throws IOException
IOException
- if a problem occurred reading the stream.public static byte[] convertToByteArray(InputStream is, int length, boolean close) throws IOException
IOException
public static int write(OutputStream out, InputStream is, byte[] l_buffer, int length) throws IOException
IOException
public static int write(OutputStream out, InputStream is, byte[] l_buffer, int length, boolean closeBoth) throws IOException
IOException
public static int write(OutputStream out, InputStream is, byte[] l_buffer, int length, boolean closeOutput, boolean closeInput) throws IOException
IOException
public static int write(OutputStream out, InputStream is, int length) throws IOException
IOException
public static int write(OutputStream out, InputStream is, int length, boolean close) throws IOException
IOException
public static int write(OutputStream out, InputStream is, int length, boolean closeOutput, boolean closeInput) throws IOException
IOException
public static int write(Writer out, Reader is, int length, boolean close) throws IOException
IOException
public static InputStream convertToInputStream(byte[] data)
public static InputStream convertToInputStream(String data)
public static InputStream convertToInputStream(char[] data)
public static void write(InputStream is, String fileName) throws IOException
IOException
public static void write(Reader reader, String fileName) throws IOException
IOException
public static void write(Reader reader, File f) throws IOException
IOException
public static void write(InputStream is, File f) throws IOException
IOException
public static char[] bytesToChar(byte[] bytes, String encoding) throws IOException
IOException
public static byte[] convertFileToByteArray(File file) throws IOException
IOException
- if a problem occurred reading the file.public static char[] convertFileToCharArray(File file, String encoding) throws IOException
IOException
- if a problem occurred reading the file.public static String convertFileToString(File file) throws IOException
IOException
- if a problem occurred reading the file.public static String convertToString(InputStream stream) throws IOException
IOException
- if a problem occurred reading the file.public static char[] convertToCharArray(InputStream stream, int length, String encoding) throws IOException
IOException
- if a problem occurred reading the stream.public static byte[] convertToByteArray(ZipEntry ze, ZipFile zip) throws IOException
IOException
- if a problem occurred reading the zip entry.public static String convertToString(Reader reader) throws IOException
IOException
public static char[] convertToCharArray(Reader reader, int length) throws IOException
IOException
Copyright © 2019. All rights reserved.