import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException; public class FileOutputStreamTest {
public static void main(String[] args) {
try {
var fis = new FileInputStream("FileInputStreamTest.java");
var fos = new FileOutputStream("output.txt");
{
var buf = new byte[];
var hasRead = ;
while ((hasRead = fis.read(buf)) > ){
fos.write(buf, , hasRead);
}
}
fis.close();
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}

learning java FileOutputStream的更多相关文章

  1. Learning Java language Fundamentals

    Chapter 2 Learning Java language fundamentals exercises: 1.What  is Unicode? Unicode is a computing ...

  2. learning java 文件锁

    import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; i ...

  3. learning java transient 自定义序例化

    public class Person implements java.io.Serializable { private String name; private transient int age ...

  4. learning java 实例序列化

    对Person类实例进行序例化及反序例化: Person.java public class Person implements java.io.Serializable { private Stri ...

  5. learning java 重定向标准输入输出

    output redirectionOut: public class RedirectOut { public static void main(String[] args) throws File ...

  6. learning java 处理流的用法

    有点重定向使用的味道 import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.Pri ...

  7. blogs for learning java

    曹海成的专栏 http://blog.csdn.net/caohaicheng/article/details/38071097 http://blog.csdn.net/a5489888/artic ...

  8. Learning Java IO indexes

    I/O Streams, it simplifies I/O operations, write a whole object out to stream & read back. File ...

  9. Learning Java 8 Syntax (Java in a Nutshell 6th)

    Java is using Unicode set Java is case sensitive Comments, C/C++ style abstract, const, final, int, ...

随机推荐

  1. GoLang基础数据类型---字典

    Map 是 Go 中的内置类型,它将键与值绑定到一起.可以通过键获取相应的值. 如何创建 map? 可以通过将键和值的类型传递给内置函数 make 来创建一个 map.语法为:make(map[Key ...

  2. 引用和自包含令牌(Reference Tokens and Introspection)

    访问令牌可以有两种形式:自包含的和引用的. 自包含令牌(Self-contained tokens): 使用受保护的.有时间限制的数据结构,该结构包含元数据,并声明通过网络传递用户或客户机的身份.一种 ...

  3. ASP.NET WebApi 学习与实践系列(2)---WebApi 路由请求的理解

    目录 写在前面 WebApi Get 请求 1.无参数的请求 2.一个参数的请求 3.多个参数的请求 4.实体参数的请求 WebApi Post 请求 1.键值对请求 2.dynamic 动态类型请求 ...

  4. js的splice和delete

    例如有一个数组是 :var textArr = ['a','b','c','d']; 这时我想删除这个数组中的b元素: 方法一:delete 删除数组 delete textArr[1]  结果为: ...

  5. 使用JDK的zip编写打包工具类

    JDK自带的zip AIP在java.util.zip包下面,主要有以下几个类: java.util.zip.ZipEntryjava.util.zip.ZipInputStreamjava.util ...

  6. 打开文件报“EFailed to load resource: net::ERR_FILE_NOT_FOUND”错误

    类似这样: 引入文件的路径错误

  7. Ext.create使用(上)

    本文介绍前两种使用方法: 通过full name, alias 或者 alternate name实例化一个类 // 别名 // alias var window = Ext.create('widg ...

  8. 纯css实现省略号,兼容火狐,IE9,chrome

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. react native错误排查-TypeError: window.deltaUrlToBlobUrl is not a function

    错误现象:window.deltaUrlToBlobUrl is not a function 最近在调试react-native时,打开浏览器调试时发现报错window.deltaUrlToBlob ...

  10. 结对项目(java实现)

    一 .Github项目地址:https://github.com/734635746/MyApp 二.PSP表格 PSP2.1 Personal Software Process Stages 预估耗 ...