Package org.apache.poi.util
Class HexRead
- java.lang.Object
-
- org.apache.poi.util.HexRead
-
public class HexRead extends Object
Utilities to read hex from files. TODO - move to test packages
-
-
Constructor Summary
Constructors Constructor Description HexRead()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
readData(InputStream stream, int eofChar)
static byte[]
readData(InputStream stream, String section)
Same as readData(String) except that this method allows you to specify sections within a file.static byte[]
readData(String filename)
This method reads hex data from a filename and returns a byte array.static byte[]
readData(String filename, String section)
static byte[]
readFromString(String data)
-
-
-
Method Detail
-
readData
public static byte[] readData(String filename) throws IOException
This method reads hex data from a filename and returns a byte array. The file may contain line comments that are preceded with a # symbol.- Parameters:
filename
- The filename to read- Returns:
- The bytes read from the file.
- Throws:
IOException
- If there was a problem while reading the file.
-
readData
public static byte[] readData(InputStream stream, String section) throws IOException
Same as readData(String) except that this method allows you to specify sections within a file. Sections are referenced using section headers in the form:[sectioname]
- Throws:
IOException
- See Also:
readData(String)
-
readData
public static byte[] readData(String filename, String section) throws IOException
- Throws:
IOException
-
readData
public static byte[] readData(InputStream stream, int eofChar) throws IOException
- Throws:
IOException
-
readFromString
public static byte[] readFromString(String data)
-
-