aicas logoJamaica 3.2 release 62

sun.text.normalizer
Class ICUBinary

java.lang.Object
  extended by sun.text.normalizer.ICUBinary

public final class ICUBinary
extends Object


Nested Class Summary
static interface ICUBinary.Authenticate
          Special interface for data authentication
 
Constructor Summary
ICUBinary()
           
 
Method Summary
static byte[] readHeader(InputStream inputStream, byte[] dataFormatIDExpected, ICUBinary.Authenticate authenticate)
          ICU data header reader method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICUBinary

public ICUBinary()
Method Detail

readHeader

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");
 }
 

Parameters:
inputStream - input stream that contains the ICU data header
dataFormatIDExpected - 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.
Throws:
IOException - thrown if there is a read error or when header authentication fails.

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.