public static void writeFile(final String filePath, final File inFile) throws IOException { Util.log(TAG, "write(),filePath:" + filePath); File file = new File(filePath); if (!file.exists()) { file.createNewFile(); } OutputStream out = new FileOutputStream(file); InputStream in = new FileInputStream(inFile); int length = -1; byte[] buffer = new byte[2048]; while ((length = in.read(buffer)) > 0) { out.write(buffer, 0, length); } in.close(); out.close(); }
public static String getReadAbleTime(long time) { SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String date = format1.format(new Date(time)); Util.log(TAG, "getReadAbleTime : " + date); return date; }