|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.core.util.ObjectConverterUtil
public class ObjectConverterUtil
Constructor Summary | |
---|---|
ObjectConverterUtil()
|
Method Summary | |
---|---|
static char[] |
bytesToChar(byte[] bytes,
java.lang.String encoding)
Returns the given bytes as a char array using a given encoding (null means platform default). |
static byte[] |
convertFileToByteArray(java.io.File file)
Returns the contents of the given file as a byte array. |
static char[] |
convertFileToCharArray(java.io.File file,
java.lang.String encoding)
Returns the contents of the given file as a char array. |
static java.lang.String |
convertFileToString(java.io.File file)
Returns the contents of the given file as a string. |
protected static byte[] |
convertToByteArray(java.sql.Blob data)
|
static byte[] |
convertToByteArray(java.io.InputStream is)
|
static byte[] |
convertToByteArray(java.io.InputStream stream,
int length)
Returns the given input stream's contents as a byte array. |
static byte[] |
convertToByteArray(java.lang.Object data)
|
static byte[] |
convertToByteArray(java.util.zip.ZipEntry ze,
java.util.zip.ZipFile zip)
Returns the contents of the given zip entry as a byte array. |
static char[] |
convertToCharArray(java.io.InputStream stream,
int length,
java.lang.String encoding)
Returns the given input stream's contents as a character array. |
static java.io.InputStream |
convertToInputStream(byte[] data)
|
static java.io.InputStream |
convertToInputStream(char[] data)
|
static java.io.InputStream |
convertToInputStream(java.io.File file)
|
static java.io.InputStream |
convertToInputStream(java.lang.String data)
|
static java.lang.String |
convertToString(java.io.InputStream stream)
Returns the contents of the given InputStream as a string. |
static void |
write(byte[] data,
java.lang.String fileName)
|
static void |
write(char[] data,
java.lang.String fileName)
|
static void |
write(java.io.InputStream is,
java.lang.String fileName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectConverterUtil()
Method Detail |
---|
protected static byte[] convertToByteArray(java.sql.Blob data) throws MetaMatrixCoreException
MetaMatrixCoreException
public static byte[] convertToByteArray(java.lang.Object data) throws MetaMatrixCoreException, java.io.IOException
MetaMatrixCoreException
java.io.IOException
public static byte[] convertToByteArray(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static java.io.InputStream convertToInputStream(byte[] data)
public static java.io.InputStream convertToInputStream(java.lang.String data)
public static java.io.InputStream convertToInputStream(char[] data)
public static void write(java.io.InputStream is, java.lang.String fileName) throws java.lang.Exception
java.lang.Exception
public static void write(byte[] data, java.lang.String fileName) throws java.lang.Exception
java.lang.Exception
public static void write(char[] data, java.lang.String fileName) throws java.lang.Exception
java.lang.Exception
public static java.io.InputStream convertToInputStream(java.io.File file)
public static char[] bytesToChar(byte[] bytes, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static byte[] convertFileToByteArray(java.io.File file) throws java.io.IOException
java.io.IOException
- if a problem occured reading the file.public static char[] convertFileToCharArray(java.io.File file, java.lang.String encoding) throws java.io.IOException
java.io.IOException
- if a problem occured reading the file.public static java.lang.String convertFileToString(java.io.File file) throws java.io.IOException
java.io.IOException
- if a problem occured reading the file.public static java.lang.String convertToString(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
- if a problem occured reading the file.public static byte[] convertToByteArray(java.io.InputStream stream, int length) throws java.io.IOException
java.io.IOException
- if a problem occured reading the stream.public static char[] convertToCharArray(java.io.InputStream stream, int length, java.lang.String encoding) throws java.io.IOException
java.io.IOException
- if a problem occured reading the stream.public static byte[] convertToByteArray(java.util.zip.ZipEntry ze, java.util.zip.ZipFile zip) throws java.io.IOException
java.io.IOException
- if a problem occured reading the zip entry.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |