public static int writeHeader ( int dataFormat , int formatVersion , int dataVersion , DataOutputStream dos ) throws IOException { // ucmndata.h MappedData dos . writeChar ( 32 ) ; // headerSize dos . writeByte ( MAGIC1 ) ; dos . writeByte ( MAGIC2 ) ; // unicode/udata.h UDataInfo dos . writeChar ( 20 ) ; // sizeof(UDataInfo) dos . writeChar ( 0 ) ; // reservedWord dos . writeByte ( 1 ) ; // isBigEndian dos . writeByte ( CHAR_SET_ ) ; // charsetFamily dos . writeByte ( CHAR_SIZE_ ) ; // sizeofUChar dos . writeByte ( 0 ) ; // reservedByte dos . writeInt ( dataFormat ) ; dos . writeInt ( formatVersion ) ; dos . writeInt ( dataVersion ) ; // 8 bytes padding for 32 bytes headerSize (multiple of 16). dos . writeLong ( 0 ) ; assert dos . size ( ) == 32 ; return 32 ; }
Writes an ICU data header . Does not write a copyright string .