public final class ICUBinary extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ICUBinary.Authenticate
Special interface for data authentication
|
| Constructor and Description |
|---|
ICUBinary() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
readHeader(InputStream inputStream,
byte[] dataFormatIDExpected,
ICUBinary.Authenticate authenticate)
ICU data header reader method.
|
public static final byte[] readHeader(InputStream inputStream, byte[] dataFormatIDExpected, ICUBinary.Authenticate authenticate) throws IOException
ICU data header reader method. Takes a ICU generated big-endian input stream, parse the ICU standard file header and authenticates them.
Header format:
Example of use:
try {
FileInputStream input = new FileInputStream(filename);
If (Utility.readICUDataHeader(input, dataformat, dataversion,
unicode) {
System.out.println("Verified file header, this is a ICU data file");
}
} catch (IOException e) {
System.out.println("This is not a ICU data file");
}
inputStream - input stream that contains the ICU data headerdataFormatIDExpected - Data format expected. An array of 4 bytes
information about the data format.
E.g. data format ID 1.2.3.4. will became an array of
{1, 2, 3, 4}authenticate - user defined extra data authentication. This value
can be null, if no extra authentication is needed.IOException - thrown if there is a read error or
when header authentication fails.Copyright © 2010 - 2020 Adobe. All Rights Reserved