标签:string demo system stat puts out parse style finally
public class Demo { public static void main(String[] args) throws ParseException, IOException { FileInputStream fileInputStream = new FileInputStream("D:\\Desktop\\aa.txt"); System.out.println(contentLength(fileInputStream)); } public static long contentLength(InputStream is) throws IOException { try { long size = 0; byte[] buf = new byte[256]; int read; while ((read = is.read(buf)) != -1) { size += read; } return size; } finally { try { is.close(); } catch (IOException ex) { } } } }
标签:string demo system stat puts out parse style finally
原文地址:https://www.cnblogs.com/yangxiaohui227/p/12109045.html