@Test public void checkMD5_1000() throws Exception { byte[] expected = {(byte)0x6B, (byte)0xF9, (byte)0x5A, (byte)0x48, (byte)0xF3, (byte)0x66, (byte)0xBD, (byte)0xF8, (byte)0XAF, 0x3A, (byte)0x19, (byte)0x8C, (byte)0x7B, (byte)0x72, (byte)0x3C, (byte)0x77}; byte[] md5 = this.cache.load(5000L); assertArrayEquals("MD5 mismatch", expected, md5); }
@Override public byte[] load(final Long key) throws Exception { checkNotNull(key); _logger.debug("Loading md5 digest for size [{}]", key); final HashingInputStream hashStream = new HashingInputStream(Hashing.md5(), Streams.create(Bodies.zeroes(key))); final byte[] buffer = new byte[4096]; while (hashStream.read(buffer) != -1) { } hashStream.close(); return hashStream.hash().asBytes(); }
MD5DigestLoader extends CacheLoader<Long, byte[]> { @Override public byte[] load(final Long key) throws Exception { checkNotNull(key); _logger.debug("Loading md5 digest for size [{}]", key); final HashingInputStream hashStream = new HashingInputStream(Hashing.md5(), Streams.create(Bodies.zeroes(key))); final byte[] buffer = new byte[4096]; while (hashStream.read(buffer) != -1) { } hashStream.close(); return hashStream.hash().asBytes(); } }
MD5DigestLoader extends CacheLoader<Long, byte[]> { @Override public byte[] load(final Long key) throws Exception { checkNotNull(key); _logger.debug("Loading md5 digest for size [{}]", key); final HashingInputStream hashStream = new HashingInputStream(Hashing.md5(), Streams.create(Bodies.zeroes(key))); final byte[] buffer = new byte[4096]; while (hashStream.read(buffer) != -1) { } hashStream.close(); return hashStream.hash().asBytes(); }  }
MD5DigestLoader extends CacheLoader<Long, byte[]> { @Override public byte[] load(final Long key) throws Exception { checkNotNull(key); _logger.debug("Loading md5 digest for size [{}]", key); final HashingInputStream hashStream = new HashingInputStream(Hashing.md5(), Streams.create(Bodies.zeroes(key))); final byte[] buffer = new byte[4096]; while (hashStream.read(buffer) != -1) { } hashStream.close(); return hashStream.hash().asBytes(); }  @Override byte[] load(final Long key); }
MD5DigestLoader extends CacheLoader<Long, byte[]> { @Override public byte[] load(final Long key) throws Exception { checkNotNull(key); _logger.debug("Loading md5 digest for size [{}]", key); final HashingInputStream hashStream = new HashingInputStream(Hashing.md5(), Streams.create(Bodies.zeroes(key))); final byte[] buffer = new byte[4096]; while (hashStream.read(buffer) != -1) { } hashStream.close(); return hashStream.hash().asBytes(); }  @Override byte[] load(final Long key);  }