< prev index next >
src/java.base/share/classes/sun/text/normalizer/ICUBinary.java
Print this page
*** 45,55 ****
public final class ICUBinary {
private static final class IsAcceptable implements Authenticate {
@Override
! public boolean isDataVersionAcceptable(byte version[]) {
return version[0] == 1;
}
}
// public inner interface ------------------------------------------------
--- 45,55 ----
public final class ICUBinary {
private static final class IsAcceptable implements Authenticate {
@Override
! public boolean isDataVersionAcceptable(byte[] version) {
return version[0] == 1;
}
}
// public inner interface ------------------------------------------------
*** 63,73 ****
* Method used in ICUBinary.readHeader() to provide data format
* authentication.
* @param version version of the current data
* @return true if dataformat is an acceptable version, false otherwise
*/
! public boolean isDataVersionAcceptable(byte version[]);
}
// public methods --------------------------------------------------------
/**
--- 63,73 ----
* Method used in ICUBinary.readHeader() to provide data format
* authentication.
* @param version version of the current data
* @return true if dataformat is an acceptable version, false otherwise
*/
! public boolean isDataVersionAcceptable(byte[] version);
}
// public methods --------------------------------------------------------
/**
*** 108,118 ****
return getVersionInfoFromCompactInt(readHeader(bytes, dataFormat, authenticate));
}
private static final byte BIG_ENDIAN_ = 1;
public static final byte[] readHeader(InputStream inputStream,
! byte dataFormatIDExpected[],
Authenticate authenticate)
throws IOException
{
DataInputStream input = new DataInputStream(inputStream);
char headersize = input.readChar();
--- 108,118 ----
return getVersionInfoFromCompactInt(readHeader(bytes, dataFormat, authenticate));
}
private static final byte BIG_ENDIAN_ = 1;
public static final byte[] readHeader(InputStream inputStream,
! byte[] dataFormatIDExpected,
Authenticate authenticate)
throws IOException
{
DataInputStream input = new DataInputStream(inputStream);
char headersize = input.readChar();
*** 137,153 ****
byte charsize = input.readByte();
readcount ++;
input.readByte(); // reading reserved byte
readcount ++;
! byte dataFormatID[] = new byte[4];
input.readFully(dataFormatID);
readcount += 4;
! byte dataVersion[] = new byte[4];
input.readFully(dataVersion);
readcount += 4;
! byte unicodeVersion[] = new byte[4];
input.readFully(unicodeVersion);
readcount += 4;
if (headersize < readcount) {
throw new IOException("Internal Error: Header size error");
}
--- 137,153 ----
byte charsize = input.readByte();
readcount ++;
input.readByte(); // reading reserved byte
readcount ++;
! byte[] dataFormatID = new byte[4];
input.readFully(dataFormatID);
readcount += 4;
! byte[] dataVersion = new byte[4];
input.readFully(dataVersion);
readcount += 4;
! byte[] unicodeVersion = new byte[4];
input.readFully(unicodeVersion);
readcount += 4;
if (headersize < readcount) {
throw new IOException("Internal Error: Header size error");
}
< prev index next >