IO流用于在设备间进行数据传输的操作。

凡是从外部设备流向中央处理器cpu的数据流,称为输入流,即程序读数据的时候用输入流;

凡是从中央处理器CPU流向外部设备的数据流,称为输出流,即程序把数据写入外设的时候用输出流;

Java IO流类图结构:

  IO流分类

字节流:

InputStream

FileInputStream

BufferedInputStream

OutputStream

FileOutputStream

BufferedOutputStream

字符流:

Reader

FileReader

BufferedReader

Writer

FileWriter

BufferedWriter

一、FileInputStream/FileOutputStream

  1. /**
  2. * IO流读取操作,将项目下的read.txt的内容写到write.txt中
  3. *
  4. * @author sun
  5. *
  6. */
  7. public class DemoIO {
  8. public static void main(String[] args) throws IOException {
  9. FileInputStream fileInputStream = new FileInputStream("read.txt");
  10. FileOutputStream fileOutputStream = new FileOutputStream("write.txt");
  11. byte[] bys = new byte[1024];
  12. int len = 0;
  13. while ((len = fileInputStream.read(bys)) != -1) {
  14. fileOutputStream.write(bys, 0, len);
  15. }
  16. // 关闭流,采用“先开后关原则”
  17. fileOutputStream.close();
  18. fileInputStream.close();
  19. }
  20. }

二、FileInputStream/BufferedInputStream; FileOutputStream/ BufferedOutputStream

使用实例:

  1. /**
  2. * 需求:把当前项目目录下的read.txt复制到当前项目目录下的write.txt中
  3. *
  4. * @author sun
  5. *
  6. */
  7. public class Demo {
  8. public static void main(String[] args) throws IOException {
  9. method4("read.txt", "write.txt");
  10. }
  11.  
  12. // 高效字节流一次读写一个字节数组:
  13. public static void method4(String srcString, String destString) throws IOException {
  14. BufferedInputStream bis = new BufferedInputStream(new FileInputStream(srcString));
  15. BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destString));
  16.  
  17. byte[] bys = new byte[1024];
  18. int len = 0;
  19. while ((len = bis.read(bys)) != -1) {
  20. bos.write(bys, 0, len);
  21. }
  22.  
  23. bos.close();
  24. bis.close();
  25. }
  26.  
  27. // 高效字节流一次读写一个字节:
  28. public static void method3(String srcString, String destString) throws IOException {
  29. BufferedInputStream bis = new BufferedInputStream(new FileInputStream(srcString));
  30. BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destString));
  31.  
  32. int by = 0;
  33. while ((by = bis.read()) != -1) {
  34. bos.write(by);
  35.  
  36. }
  37.  
  38. bos.close();
  39. bis.close();
  40. }
  41.  
  42. // 基本字节流一次读写一个字节数组
  43. public static void method2(String srcString, String destString) throws IOException {
  44. FileInputStream fis = new FileInputStream(srcString);
  45. FileOutputStream fos = new FileOutputStream(destString);
  46.  
  47. byte[] bys = new byte[1024];
  48. int len = 0;
  49. while ((len = fis.read(bys)) != -1) {
  50. fos.write(bys, 0, len);
  51. }
  52.  
  53. fos.close();
  54. fis.close();
  55. }
  56.  
  57. // 基本字节流一次读写一个字节
  58. public static void method1(String srcString, String destString) throws IOException {
  59. FileInputStream fis = new FileInputStream(srcString);
  60. FileOutputStream fos = new FileOutputStream(destString);
  61.  
  62. int by = 0;
  63. while ((by = fis.read()) != -1) {
  64. fos.write(by);
  65. }
  66.  
  67. fos.close();
  68. fis.close();
  69. }
  70. }

  

当我们创建字节输出流对象时,做了几件事情?
1:调用系统功能创建文件;
2:创建对象;
3:让该对象指向文件;

三、字符流 = 字节流 + 编码表

字符流

Reader

|--InputStreamReader

|--FileReader

|--BufferedReader

Writer

|--OutputStreamWriter

|--FileWriter

|--BufferedWriter

  1. /**
  2. * 把当前项目目录下的a.txt内容复制到当前项目目录下的b.txt中
  3. *
  4. * @author sun
  5. *
  6. */
  7. public class DemoIO {
  8. public static void main(String[] args) throws IOException {
  9. // 封装数据源
  10. BufferedReader br = new BufferedReader(new FileReader("a.txt"));
  11. // 封装目的地
  12. BufferedWriter bw = new BufferedWriter(new FileWriter("b.txt"));
  13.  
  14. // 两种方式其中的一种一次读写一个字符数组
  15. char[] chs = new char[1024];
  16. int len = 0;
  17. while ((len = br.read(chs)) != -1) {
  18. bw.write(chs, 0, len);
  19. bw.flush();
  20. }
  21.  
  22. // 释放资源
  23. bw.close();
  24. br.close();
  25. }
  26. }

 

  1. public class CopyFileDemo2 {
  2. public static void main(String[] args) throws IOException {
  3. // 封装数据源
  4. BufferedReader br = new BufferedReader(new FileReader("a.txt"));
  5. // 封装目的地
  6. BufferedWriter bw = new BufferedWriter(new FileWriter("b.txt"));
  7.  
  8. // 读写数据
  9. String line = null;
  10. while ((line = br.readLine()) != null) {
  11. bw.write(line);
  12. bw.newLine();
  13. bw.flush();
  14. }
  15.  
  16. // 释放资源
  17. bw.close();
  18. br.close();
  19. }
  20. } 

四、数据操作流(操作基本类型数据的流)
(1)可以操作基本类型的数据
(2)流对象名称
DataInputStream
DataOutputStream

  1. /**
  2. *
  3. * @author sun
  4. *
  5. */
  6. public class DemoIO {
  7. public static void main(String[] args) throws IOException {
  8. // 写
  9. // write();
  10.  
  11. // 读
  12. read();
  13. }
  14.  
  15. private static void read() throws IOException {
  16. // DataInputStream(InputStream in)
  17. // 创建数据输入流对象
  18. DataInputStream dis = new DataInputStream(new FileInputStream("write.txt"));
  19.  
  20. // 读数据
  21. byte b = dis.readByte();
  22. short s = dis.readShort();
  23. int i = dis.readInt();
  24. long l = dis.readLong();
  25. float f = dis.readFloat();
  26. double d = dis.readDouble();
  27. char c = dis.readChar();
  28. boolean bb = dis.readBoolean();
  29.  
  30. // 释放资源
  31. dis.close();
  32.  
  33. System.out.println(b);
  34. System.out.println(s);
  35. System.out.println(i);
  36. System.out.println(l);
  37. System.out.println(f);
  38. System.out.println(d);
  39. System.out.println(c);
  40. System.out.println(bb);
  41. }
  42.  
  43. private static void write() throws IOException {
  44. // DataOutputStream(OutputStream out)
  45. // 创建数据输出流对象
  46. DataOutputStream dos = new DataOutputStream(new FileOutputStream("read.txt"));
  47.  
  48. // 写数据了
  49. dos.writeByte(10);
  50. dos.writeShort(100);
  51. dos.writeInt(1000);
  52. dos.writeLong(10000);
  53. dos.writeFloat(12.34F);
  54. dos.writeDouble(12.56);
  55. dos.writeChar('a');
  56. dos.writeBoolean(true);
  57.  
  58. // 释放资源
  59. dos.close();
  60. }
  61. }

五、内存操作流
(1)有些时候我们操作完毕后,未必需要产生一个文件,就可以使用内存操作流。
(2)三种
A:ByteArrayInputStream,ByteArrayOutputStream
B:CharArrayReader,CharArrayWriter
C:StringReader,StringWriter

  1. /*
  2. * 内存操作流:用于处理临时存储信息的,程序结束,数据就从内存中消失。
  3. * 字节数组:
  4. * ByteArrayInputStream
  5. * ByteArrayOutputStream
  6. * 字符数组:
  7. * CharArrayReader
  8. * CharArrayWriter
  9. * 字符串:
  10. * StringReader
  11. * StringWriter
  12. */
  13. public class ByteArrayStreamDemo {
  14. public static void main(String[] args) throws IOException {
  15. // 写数据
  16. ByteArrayOutputStream baos = new ByteArrayOutputStream();
  17. // 写数据
  18. for (int x = 0; x < 10; x++) {
  19. baos.write(("hello" + x).getBytes());
  20. }
  21.  
  22. byte[] bys = baos.toByteArray();
  23.  
  24. // 读数据
  25. // ByteArrayInputStream(byte[] buf)
  26. ByteArrayInputStream bais = new ByteArrayInputStream(bys);
  27.  
  28. int by = 0;
  29. while ((by = bais.read()) != -1) {
  30. System.out.print((char) by);
  31. }
  32.  
  33. baos.close();
  34. bais.close();
  35. }
  36. }

六、打印流
(1)字节打印流,PrintWriter ;字符打印流,PrintStream ;
(2)特点:
A:只操作目的地,不操作数据源
B:可以操作任意类型的数据
C:如果启用了自动刷新,在调用println()方法的时候,能够换行并刷新
D:可以直接操作文件
问题:哪些流可以直接操作文件呢?
看API,如果其构造方法能够同时接收File和String类型的参数,一般都是可以直接操作文件的
(3)复制文本文件
BufferedReader br = new BufferedReader(new FileReader("a.txt"));
PrintWriter pw = new PrintWriter(new FileWriter("b.txt"),true);

String line = null;
while((line=br.readLine())!=null) {
pw.println(line);
}

pw.close();
br.close();

  1. public class PrintWriterDemo2 {
  2. public static void main(String[] args) throws IOException {
  3. // 创建打印流对象
  4. // PrintWriter pw = new PrintWriter("pw2.txt");
  5. PrintWriter pw = new PrintWriter(new FileWriter("read.txt"), true);
  6.  
  7. // write()是搞不定的,怎么办呢?
  8. // 我们就应该看看它的新方法
  9. // pw.print(true);
  10. // pw.print(100);
  11. // pw.print("hello");
  12.  
  13. pw.println("hello");
  14. pw.println(true);
  15. pw.println(100);
  16.  
  17. pw.close();
  18. }
  19. }

七、标准输入输出流
(1)System类下面有这样的两个字段
in 标准输入流
out 标准输出流
(2)三种键盘录入方式
A:main方法的args接收参数
B:System.in通过BufferedReader进行包装
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
C:Scanner
Scanner sc = new Scanner(System.in);
(3)输出语句的原理和如何使用字符流输出数据
A:原理
System.out.println("helloworld");
PrintStream ps = System.out;
ps.println("helloworld");

B:把System.out用字符缓冲流包装一下使用
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

  1. public class Demo {
  2. public static void main(String[] args) throws IOException {
  3. BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  4.  
  5. System.out.println("请输入一个字符串:");
  6. String line = br.readLine();
  7. System.out.println("你输入的字符串是:" + line);
  8.  
  9. System.out.println("请输入一个整数:");
  10. line = br.readLine();
  11. int i = Integer.parseInt(line);
  12. System.out.println("你输入的整数是:" + i);
  13. }
  14. }

  

八、随机访问流
(1)可以按照文件指针的位置写数据和读数据。

  1. /*
  2. * 随机访问流:
  3. * RandomAccessFile类不属于流,是Object类的子类。
  4. * 但它融合了InputStream和OutputStream的功能。
  5. * 支持对文件的随机访问读取和写入。
  6. *
  7. * public RandomAccessFile(String name,String mode):第一个参数是文件路径,第二个参数是操作文件的模式。
  8. * 模式有四种,我们最常用的一种叫"rw",这种方式表示我既可以写数据,也可以读取数据
  9. */
  10. public class RandomAccessFileDemo {
  11. public static void main(String[] args) throws IOException {
  12. // write();
  13. read();
  14. }
  15.  
  16. private static void read() throws IOException {
  17. // 创建随机访问流对象
  18. RandomAccessFile raf = new RandomAccessFile("raf.txt", "rw");
  19.  
  20. int i = raf.readInt();
  21. System.out.println(i);
  22. // 该文件指针可以通过 getFilePointer方法读取,并通过 seek 方法设置。
  23. System.out.println("当前文件的指针位置是:" + raf.getFilePointer());
  24.  
  25. char ch = raf.readChar();
  26. System.out.println(ch);
  27. System.out.println("当前文件的指针位置是:" + raf.getFilePointer());
  28.  
  29. String s = raf.readUTF();
  30. System.out.println(s);
  31. System.out.println("当前文件的指针位置是:" + raf.getFilePointer());
  32.  
  33. // 我不想重头开始了,我就要读取a,怎么办呢?
  34. raf.seek(4);
  35. ch = raf.readChar();
  36. System.out.println(ch);
  37. }
  38.  
  39. private static void write() throws IOException {
  40. // 创建随机访问流对象
  41. RandomAccessFile raf = new RandomAccessFile("raf.txt", "rw");
  42.  
  43. // 怎么玩呢?
  44. raf.writeInt(100);
  45. raf.writeChar('a');
  46. raf.writeUTF("中国");
  47.  
  48. raf.close();
  49. }
  50. }

九、合并流
(1)把多个输入流的数据写到一个输出流中。
(2)构造方法:
A:SequenceInputStream(InputStream s1, InputStream s2)

B:SequenceInputStream(Enumeration<? extends InputStream> e)

  1. public class SequenceInputStreamDemo2 {
  2. public static void main(String[] args) throws IOException {
  3. // 需求:把下面的三个文件的内容复制到Copy.java中
  4. Vector<InputStream> v = new Vector<InputStream>();
  5. InputStream s1 = new FileInputStream("ByteArrayStreamDemo.java");
  6. InputStream s2 = new FileInputStream("CopyFileDemo.java");
  7. InputStream s3 = new FileInputStream("DataStreamDemo.java");
  8. v.add(s1);
  9. v.add(s2);
  10. v.add(s3);
  11. Enumeration<InputStream> en = v.elements();
  12. SequenceInputStream sis = new SequenceInputStream(en);
  13. BufferedOutputStream bos = new BufferedOutputStream(
  14. new FileOutputStream("Copy.java"));
  15.  
  16. byte[] bys = new byte[1024];
  17. int len = 0;
  18. while ((len = sis.read(bys)) != -1) {
  19. bos.write(bys, 0, len);
  20. }
  21.  
  22. bos.close();
  23. sis.close();
  24. }
  25. }

十、序列化流
(1)可以把对象写入文本文件或者在网络中传输
(2)如何实现序列化呢?
让被序列化的对象所属类实现序列化接口。
该接口是一个标记接口。没有功能需要实现。
(3)注意问题:
把数据写到文件后,在去修改类会产生一个问题。
如何解决该问题呢?
在类文件中,给出一个固定的序列化id值。
而且,这样也可以解决黄色警告线问题

  1. /*
  2. * 序列化流:把对象按照流一样的方式存入文本文件或者在网络中传输。对象 -- 流数据(ObjectOutputStream)
  3. * 反序列化流:把文本文件中的流对象数据或者网络中的流对象数据还原成对象。流数据 -- 对象(ObjectInputStream)
  4. */
  5. public class ObjectStreamDemo {
  6. public static void main(String[] args) throws IOException,
  7. ClassNotFoundException {
  8.  
  9. // write();
  10.  
  11. read();
  12. }
  13.  
  14. private static void read() throws IOException, ClassNotFoundException {
  15. // 创建反序列化对象
  16. ObjectInputStream ois = new ObjectInputStream(new FileInputStream(
  17. "oos.txt"));
  18.  
  19. // 还原对象
  20. Object obj = ois.readObject();
  21.  
  22. // 释放资源
  23. ois.close();
  24.  
  25. // 输出对象
  26. System.out.println(obj);
  27. }
  28.  
  29. private static void write() throws IOException {
  30. // 创建序列化流对象
  31. ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(
  32. "oos.txt"));
  33.  
  34. // 创建对象
  35. Person p = new Person("sunting", 7);
  36.  
  37. // public final void writeObject(Object obj)
  38. oos.writeObject(p);
  39.  
  40. // 释放资源
  41. oos.close();
  42. }
  43. }

  

十一、Properties
(1)是一个集合类,Hashtable的子类
(2)特有功能
A:public Object setProperty(String key,String value)
B:public String getProperty(String key)
C:public Set<String> stringPropertyNames()
(3)和IO流结合的方法
把键值对形式的文本文件内容加载到集合中
public void load(Reader reader)
public void load(InputStream inStream)

把集合中的数据存储到文本文件中
public void store(Writer writer,String comments)
public void store(OutputStream out,String comments)

  1. public class PropertiesDemo{
  2. public static void main(String[] args) throws IOException {
  3. // myLoad();
  4.  
  5. myStore();
  6. }
  7.  
  8. private static void myStore() throws IOException {
  9. // 创建集合对象
  10. Properties prop = new Properties();
  11.  
  12. prop.setProperty("sun", "7");
  13. prop.setProperty("ting", "3");
  14. prop.setProperty("s", "8");
  15.  
  16. //public void store(Writer writer,String comments):把集合中的数据存储到文件
  17. Writer w = new FileWriter("name.txt");
  18. prop.store(w, "helloworld");
  19. w.close();
  20. }
  21.  
  22. private static void myLoad() throws IOException {
  23. Properties prop = new Properties();
  24.  
  25. // public void load(Reader reader):把文件中的数据读取到集合中
  26. // 注意:这个文件的数据必须是键值对形式
  27. Reader r = new FileReader("prop.txt");
  28. prop.load(r);
  29. r.close();
  30.  
  31. System.out.println("prop:" + prop);
  32. }
  33. }

十二、NIO
(1)JDK4出现的NIO,对以前的IO操作进行了优化,提供了效率。但是大部分我们看到的还是以前的IO
(2)JDK7的NIO的使用
Path:路径
Paths:通过静态方法返回一个路径
Files:提供了常见的功能
复制文本文件
把集合中的数据写到文本文件

  1. /*
  2. * nio包在JDK4出现,提供了IO流的操作效率。但是目前还不是大范围的使用。
  3. *
  4. * JDK7的之后的nio:
  5. * Path:路径
  6. * Paths:有一个静态方法返回一个路径
  7. * public static Path get(URI uri)
  8. * Files:提供了静态方法供我们使用
  9. * public static long copy(Path source,OutputStream out):复制文件
  10. * public static Path write(Path path,Iterable<? extends CharSequence> lines,Charset cs,OpenOption... options)
  11. */
  12. public class NIODemo {
  13. public static void main(String[] args) throws IOException {
  14. // public static long copy(Path source,OutputStream out)
  15. // Files.copy(Paths.get("ByteArrayStreamDemo.java"), new
  16. // FileOutputStream(
  17. // "Copy.java"));
  18.  
  19. ArrayList<String> array = new ArrayList<String>();
  20. array.add("hello");
  21. array.add("world");
  22. array.add("java");
  23. Files.write(Paths.get("array.txt"), array, Charset.forName("GBK"));
  24. }
  25. }  

最后的最后,让我们来聊聊路径~~

在JavaIO流中读取文件,必然逃脱不了文件路径问题。接下来我们聊聊文件的路径问题。

十四、关于文件读取时路径问题:

在eclipse中的情况:

Eclipse中启动jvm都是在项目根路径上启动的.比如有个项目名为demo,其完整路径为:D:\workspace \demo.那么这个路径就是jvm的启动路径了.所以以上代码如果在eclipse里运行,则输出结果为” D:\workspace \demo.”

Tomcat中的情况.

如果在tomcat中运行web应用,此时,如果我们在某个类中使用如下代码:

File f = new File(“.”);

String absolutePath = f.getAbsolutePath();

System.out.println(absolutePath);

那么输出的将是tomcat下的bin目录.我的机器就是” D:\apache-tomcat-8.0.37\bin\.”,由此可以看出tomcat服务器是在bin目录下启动jvm 的.其实是在bin目录下的” catalina.bat”文件中启动jvm的.

java基础06 IO流的更多相关文章

  1. java基础之IO流(二)之字符流

    java基础之IO流(二)之字符流 字符流,顾名思义,它是以字符为数据处理单元的流对象,那么字符流和字节流之间的关系又是如何呢? 字符流可以理解为是字节流+字符编码集额一种封装与抽象,专门设计用来读写 ...

  2. java基础之IO流(一)字节流

    java基础之IO流(一)之字节流 IO流体系太大,涉及到的各种流对象,我觉得很有必要总结一下. 那什么是IO流,IO代表Input.Output,而流就是原始数据源与目标媒介的数据传输的一种抽象.典 ...

  3. Java基础之IO流整理

    Java基础之IO流 Java IO流使用装饰器设计模式,因此如果不能理清其中的关系的话很容易把各种流搞混,此文将简单的几个流进行梳理,后序遇见新的流会继续更新(本文下方还附有xmind文件链接) 抽 ...

  4. 【java基础】]IO流

    IO流 概念: 流的概念源于unix中管道(pipe)的概念,在unix中,管道是一条不间断的字节流,用来实现程序或进程间的通信,或读写外围设备,外部文件等 一个流,一定能够会有源和去向(目的地),他 ...

  5. java基础之 IO流

    javaIO流   IO流 : (input  output) 输入输出流 :输入 :将文件读到内存中 输出:将文件从内存输出到其他地方.   IO技术的作用:主要就是解决设备和设备之间的数据传输问题 ...

  6. java基础44 IO流技术(输出字节流/缓冲输出字节流)和异常处理

    一.输出字节流 输出字节流的体系: -------| OutputStream:所有输出字节流的基类(抽象类) ----------| FileOutputStream:向文件输出数据的输出字节流(把 ...

  7. java基础之io流总结一:io流概述

    IO流概念: 流是一组有顺序的,有起点和终点的字节集合,是对数据传输的总称或抽象.io流是实现输入和输出的基础,可以方便的实现数据的输入和输出操作. IO流的分类: 根据处理数据类型的不同分为:字符流 ...

  8. 黑马程序员——JAVA基础之IO流FileReader,FileWriter

    ------- android培训.java培训.期待与您交流! ---------- IO(Input Output)流  IO流用来处理设备之间的数据传输 Java对数据的操作是通过流的方式 J ...

  9. java基础之IO流及递归理解

    一.IO流(简单理解是input/output流,数据流内存到磁盘或者从磁盘到内存等) 二.File类(就是操作文件和文件夹的) 1.FIleFile类构造方法 注意:通过构造方法创建的file对象是 ...

随机推荐

  1. Android依赖管理与私服搭建

    在Android开发中,一个项目需要依赖许多的库,我们自己写的,第三方的等等,这篇文件介绍的就是自己搭建私服,创建自己的仓库,进行对我们自己写的库依赖管理.本文是在 mac book pro 环境上搭 ...

  2. OpenGL教程(1)——准备

    在正式开始学习OpenGL之前,我们需要先配置好OpenGL环境. IDE 首先我们需要选择一个IDE.支持OpenGL的IDE有很多,这里我们选择Visual Studio 2015(Windows ...

  3. 【 js 基础 】【 源码学习 】源码设计 (持续更新)

    学习源码,除了学习对一些方法的更加聪明的代码实现,同时也要学习源码的设计,把握整体的架构.(推荐对源码有一定熟悉了之后,再看这篇文章) 目录结构:第一部分:zepto 设计分析第二部分:undersc ...

  4. 一天搞定CSS:定位position--17

    1.定位取值概览 2.相对定位relative <!DOCTYPE html> <html> <head> <meta charset="UTF-8 ...

  5. Asp.Net页面传值的方法简单总结【原创】

    1.QueryString 当页面上form按照get的方式向页面发送请求数据的时候,web server会将请求数据放入 一个QEURY_STRING的环境变量中,然后通过QeueryString方 ...

  6. JQuery与js具体使用的区别(不全,初学)

    jQuery能大大简化Javascript程序的编写 要使用jQuery,首先要在HTML代码最前面加上对jQuery库的引用,比如: <script language="javasc ...

  7. 掌握Chrome Developer Tools:下一阶段前端开发技术

    Tips 原文作者:Ben Edelstein 原文地址:Mastering Chrome Developer Tools: Next Level Front-End Development Tech ...

  8. Python学习:基本概念

    Python学习:基本概念 一,python的特点: 1,python应用场景多;爬虫,网站,数据挖掘,可视化演示. 2,python运行速度慢,但如果CPU够强,这差距并不明显. 3,严格的缩进式编 ...

  9. python+selenium遇到鼠标悬停不成功可以使用js进行操作

    问题:在定位这种悬停后出现下拉操作的时候,尝试了使用move_to_element的方法 # ele_logout = br.find_element_by_xpath('/html/body/div ...

  10. caffe源码学习之Proto数据格式【1】

    前言: 由于业务需要,接触caffe已经有接近半年,一直忙着阅读各种论文,重现大大小小的模型. 期间也总结过一些caffe源码学习笔记,断断续续,这次打算系统的记录一下caffe源码学习笔记,巩固一下 ...