Search This Blog

Split large file and assemble the parts

split -b 256mb large-file.tgz large-file.tgz.
cat large-file.tgz.* > /path/to/output/large-file.tgz

Thread-safe, fixed-size map remove the eldest element automatically

    public static final int MAX_SIZE = 1000;
    Map map = Collections.synchronizedMap(new LinkedHashMap() {
       private static final long serialVersionUID = 12345L; 
       @Override
       protected boolean removeEldestEntry(Entry eldest) {
           return size() > MAX_SIZE;
       }               
    });



See also stackoverflow

  • https://stackoverflow.com/a/28654664
  • https://stackoverflow.com/a/1963881