|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.util.io.IOUtil
public class IOUtil
Method Summary | |
---|---|
static void |
copyStreams(java.io.InputStream is,
java.io.OutputStream os)
Copy all the data from an INputStream to an OutputStream. |
static java.lang.String |
getFileBaseName(java.lang.String fileName)
|
static java.lang.String |
getFileExtension(java.lang.String fileName)
|
static byte |
readByte(java.io.InputStream is)
Read one byte from the Stream. |
static byte[] |
readByteArrayFromFile(java.io.File baFile)
Reads a byte array from the given file |
static byte[] |
readByteArrayFromFile(java.lang.String baFileName)
Reads a byte array from the file with the given name |
static byte[] |
readZeroTerminatedString(java.io.InputStream is,
int maxLength)
Read a 0x00 terminated String |
static void |
writeToFile(java.io.File baFile,
byte[] ba)
Write the byte array to the given file |
static void |
writeToFile(java.lang.String baFileName,
byte[] ba)
Write the byte array to the file with the given file name |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static byte readByte(java.io.InputStream is) throws java.io.IOException
is
-
java.lang.Exception
java.io.IOException
public static byte[] readZeroTerminatedString(java.io.InputStream is, int maxLength) throws java.io.IOException
is
- The Stream to read from.maxLength
- The maximum amount of bytes to read.
java.io.IOException
- if something goes wrong.public static byte[] readByteArrayFromFile(java.io.File baFile) throws java.io.IOException
baFile
- File to read from
java.io.IOException
- in case of any I/O Problempublic static void writeToFile(java.lang.String baFileName, byte[] ba) throws java.io.IOException
baFileName
- Name of the file to write the byte array to.ba
- Byte Array to write to the file.
java.io.IOException
- in case of any I/O Problempublic static void writeToFile(java.io.File baFile, byte[] ba) throws java.io.IOException
baFile
- File to write the byte array to.ba
- Byte Array to write to the file.
java.io.IOException
- in case of any I/O Problempublic static byte[] readByteArrayFromFile(java.lang.String baFileName) throws java.io.IOException
baFileName
- Name of the file to read from
java.io.IOException
- in case of any I/O Problempublic static void copyStreams(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
is
- The source of the data.os
- The destination of the data.
java.io.IOException
- Upon I/O errors.public static java.lang.String getFileExtension(java.lang.String fileName)
fileName
- The name of a file possibly containing a file extension.
fileName
after the last '.' character or
null
, if fileName
contains no '.'
character.public static java.lang.String getFileBaseName(java.lang.String fileName)
fileName
- The name of a file possibly containing a file extension.
fileName
as a whole, if fileName
contains no '.' character.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |