Here you can find the source of loadJZ(File file)
public static Properties loadJZ(File file)
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Properties; public class Main { public static Properties loadJZ(File file) { Properties props = new Properties(); if (file.exists()) { try { FileReader reader = new FileReader(file); char[] buf = new char[1024]; StringBuffer buffer = new StringBuffer(); int read = 0; boolean isStarted = false; while ((read = reader.read(buf)) != -1) { buffer.append(buf, 0, read); if (buffer.length() > 10) { if (buffer.toString().startsWith("/*=j2s=")) { isStarted = true; } else {/* w w w . j a va2 s. c o m*/ return props; } } if (isStarted) { if (buffer.indexOf("=*/") != -1) { break; } } } reader.close(); if (isStarted) { String str = buffer.toString(); int idx1 = str.indexOf('\n', 7); if (idx1 != -1) { int idx2 = str.indexOf("=*/", idx1); if (idx2 != -1) { str = str.substring(idx1 + 1, idx2); props.load(new ByteArrayInputStream(str.getBytes())); } } } } catch (FileNotFoundException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } } return props; } }