Search Java Code Snippets

  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.

#Java - Code Snippets for '' - 1 code snippet(s) found

 Sample 1. Code Sample / Example / Snippet of

    private static void assertUnicodeName(final ZipArchiveEntry ze,

final String expectedName,

final String encoding)

throws IOException {

if (!expectedName.equals(ze.getName())) {

final UnicodePathExtraField ucpf = findUniCodePath(ze);


final ZipEncoding enc = ZipEncodingHelper.getZipEncoding(encoding);

final ByteBuffer ne = enc.encode(ze.getName());

final CRC32 crc = new CRC32();

crc.update(ne.array(), ne.arrayOffset(),

ne.limit() - ne.position());

assertEquals(crc.getValue(), ucpf.getNameCRC32());

assertEquals(expectedName, new String(ucpf.getUnicodeName(),




   Like      Feedback

Subscribe to Java News and Posts. Get latest updates and posts on Java from
Enter your email address:
Delivered by FeedBurner

comments powered by Disqus