private static byte[] readByteTable(DataInputStream in) throws IOException { if (in.read() != 't') throw new IOException("UnicodeNameMap file corrupt, byte table"); int n = in.readUnsignedShort(); byte[] table = new byte[n]; in.readFully(table); return table; }
private static char[] readCharTable(DataInputStream in) throws IOException { if (in.read() != 't') throw new IOException("UnicodeNameMap file corrupt, chartable"); int n = in.readUnsignedShort() / 2; char[] table = new char[n]; for (int i = 0; i < n; i++) { table[i] = in.readChar(); } return table; }