util
-
Search file in a zip file
This is an example of how to search a File in a zip file, using the ZipFile class. Searching a…
Read More » -
List contents of zip file
In this example we shall show you how to get the list of the contents of a zip file, with…
Read More » -
Calculate CRC-32 checksum of zip entry
With this example we are going to demonstrate how to calculate the CRC-32 checksum of a ZipEntry. In short, to…
Read More » -
Get zip entry compression method
This is an example of how to get the ZipEntry Compression method. The compression method of a ZipEntry can be…
Read More » -
Calculate CRC32 checksum for byte array
In this example we shall show you how to calculate the CRC32 Checksum of a byte array. To calculate the…
Read More » -
Compress Objects example
With this example we are going to demonstrate how to compress and expand an Object. We have implemented the ObjectCompressionUtil…
Read More » -
Compress – Decompress files example
This is an example of how to zip and unzip a file. We have implemented the FileCompressionUtil class, that consists…
Read More » -
CountDownLatch example of a more general wait/notify mechanism
In this example we shall show you how to create a CountDownLatch of a more general wait/notify mechanism. We have…
Read More » -
Synchronous Queue example to execute commands
private BlockingQueue workQueue = new LinkedBlockingQueue(); private Map commandQueueMap = new ConcurrentHashMap(); public SynchronousQueue addCommand(Command command) { SynchronousQueue queue =…
Read More » -
Blocking Queue example of limited connection pool
private BlockingQueue<Connection> pool = new ArrayBlockingQueue<Connection>(10); private AtomicInteger connCount = new AtomicInteger(); public Connection getConnection() { Connection conn = pool.poll(5,…
Read More »