MSIStreamName implements Comparable<MSIStreamName> { public String decode() { ByteArrayOutputStream out = new ByteArrayOutputStream(); for (char c : name.toCharArray()) { if (c >= 0x3800 && c < 0x4840) { if (c < 0x4800) { c -= 0x3800; out.write(ALPHABET[(c & MASK)]); out.write(ALPHABET[((c >> 6) & MASK)]); } else { out.write(ALPHABET[c - 0x4800]); } } else { out.write(c); } } return new String(out.toByteArray(), Charset.forName("UTF-8")); } MSIStreamName(String name); String decode(); String toString(); int compareTo(MSIStreamName other);  }
@Test public void testDecode() { assertEquals("\u0005DigitalSignature", new MSIStreamName("\u0005DigitalSignature").decode()); assertEquals("Binary.info", new MSIStreamName("\u430B\u4131\u4735\u433E\u4271\u4832").decode()); assertEquals("@_Tables", new MSIStreamName("\u4840\u3F7F\u4164\u422F\u4836").decode()); }