Esempio n. 1
0
 /**
  * Build a block from the given string.
  *
  * @param s the string
  * @return the block
  */
 public static Chunk fromString(String s) {
   HashMap<String, String> map = DataUtils.parseMap(s);
   int id = Integer.parseInt(map.get("id"));
   Chunk c = new Chunk(id);
   c.start = Long.parseLong(map.get("start"));
   c.length = Integer.parseInt(map.get("length"));
   c.pageCount = Integer.parseInt(map.get("pageCount"));
   c.maxLength = Long.parseLong(map.get("maxLength"));
   c.maxLengthLive = Long.parseLong(map.get("maxLengthLive"));
   c.metaRootPos = Long.parseLong(map.get("metaRoot"));
   c.time = Long.parseLong(map.get("time"));
   c.version = Long.parseLong(map.get("version"));
   return c;
 }