URL url = getClassLoader().getResource("com/test/io/test.txt");FileOutputStream output = new FileOutputStream("test.txt");InputStream input = url.openStream();byte [] buffer = new byte[4096];int bytesRead = input.read(buffer);while (bytesRead != -1) { output.write(buffer, 0, bytesRead); bytesRead = input.read(buffer);}output.close();input.close();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)