美文网首页
Javadoc归类

Javadoc归类

作者: 进击的勇士 | 来源:发表于2017-03-03 18:22 被阅读0次

    第一级别:精读源码

    java.io

    Provides for system input and output through data streams, serialization and the file system.

    Ensential interfaces
    1. DataInput: binary stream->bytes->java primitive type
    2. DataOutput: java primitive type->bytes->binary stream
    3. Serializable: mark as serializable
    4. FileNameFilter
    5. FileFilter
    Ensential classes
    • IO流
    image
    1. InputStream/OutputStream<-->Reader/Writer
    2. BufferedInputStream/BufferedOutputStream<-->BufferedReader/BufferedWriter
    3. ByteArrayInputStream/ByteArrayOutputStream<-->CharArrayReader/CharArrayWriter
    4. PipeInputStream/PipeOutputStream<-->PipeReader/PipeWriter
    5. FileInputStream/FileOutputStream<-->FileReader/FileWriter
    6. FilterInputStream/FilterOutputStream<-->FilterReader/FilterWriter

    1. StringBufferInputStream<-->StringReader/StringWriter

    1. DataInputStream/DataOutputStream
    2. ObjectInputStream/ObjectOutputStream
    3. PriterWriter/PriterReader
    4. SequenceInputStream

    Main Useage

    一、按数据来源(去向)分类:

    1. 是文件: FileInputStream, FileOutputStream, ( 字节流 )FileReader, FileWriter( 字符 )
    2. 是 byte[] : ByteArrayInputStream, ByteArrayOutputStream( 字节流 )
    3. 是 Char[]: CharArrayReader, CharArrayWriter( 字符流 )
    4. 是 String: StringBufferInputStream, StringBufferOuputStream ( 字节流 )StringReader, StringWriter( 字符流 )
    5. 网络数据流: InputStream, OutputStream,( 字节流 ) Reader, Writer( 字符流 )

    二、按是否格式化输出分:

    1. 要格式化输出: PrintStream, PrintWriter

    三、按是否要缓冲分:

    1. 要缓冲: BufferedInputStream, BufferedOutputStream,( 字节流 ) BufferedReader, BufferedWriter( 字符流 )

    四、按数据格式分:

    1. 二进制格式(只要不能确定是纯文本的) : InputStream, OutputStream 及其所有带 Stream 结束的子类
    2. 纯文本格式(含纯英文与汉字或其他编码方式); Reader, Writer 及其所有带 Reader, Writer 的子类

    五、按输入输出分:

    1. 输入: Reader, InputStream 类型的子类
    2. 输出: Writer, OutputStream 类型的子类

    六、特殊需要:

    1. 从 Stream 到 Reader,Writer 的转换类: InputStreamReader, OutputStreamWriter
    2. 对象输入输出: ObjectInputStream, ObjectOutputStream
    3. 进程间通信: PipeInputStream, PipeOutputStream, PipeReader, PipeWriter
    4. 合并输入: SequenceInputStream
    5. 更特殊的需要: PushbackInputStream, PushbackReader, LineNumberInputStream, LineNumberReader

    决定使用哪个类以及它的构造进程的一般准则如下(不考虑特殊需要):

    1. 考虑最原始的数据格式是什么: 原则四
    2. 是输入还是输出:原则五
    3. 是否需要转换流:原则六第 1 点
    4. 数据来源(去向)是什么:原则一
    5. 是否要缓冲:原则三 (特别注明:一定要注意的是 readLine() 是否有定义,有什么比 read, write 更特殊的输入或输出方法)
    6. 是否要格式化输出:原则二

    • File and FileDescriptor

    java.lang

    Provides classes that are fundamental to the design of the Java programming language.

    Ensential interfaces

    1. Comparable
    2. Iterable
    3. Runnable

    Ensenti classes

    1. Object
    2. Number
    3. Boolean/Byte/Short/Integer/Long/Float/Double/Character
    4. Class/ClassLoader
    5. Enum/StrictMath/Math
    6. Package/Void/Runtime/Throwable
    7. Process/ProcessBuilder/Thread/ThradLocal/ThreadGroup
    8. System/SecurityManager
    9. String/StringBuffer(很多方法加了synchronized)/StringBuilder

    java.util

    Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).

    Ensential interfaces

    imageimage
    1. Collection/Set/SortedSet/List/ListIterator/Deque/Queue/SortedMap/Map/Map.Entry
    2. Comparator
    3. Enumeration
    4. EventListener
    5. Iterator

    Ensenti classes

    第二级别:深刻理解

    • java.lang.reflect
    • java.net
    • javax.net.*
    • java.nio.*
    • java.util.concurrent.*

    第三级别:会用即可

    • java.lang.annotation
    • javax.annotation.*
    • java.lang.ref
    • java.math
    • java.rmi.*
    • javax.rmi.*
    • java.security.*
    • javax.security.*
    • java.sql
    • javax.sql.*
    • javax.transaction.*
    • java.text
    • javax.xml.*
    • org.w3c.dom.*
    • org.xml.sax.*
    • javax.crypto.*
    • javax.imageio.*
    • javax.jws.*
    • java.util.jar
    • java.util.logging
    • java.util.prefs
    • java.util.regex
    • java.util.zip

    第四级别:请无视它

    相关文章

      网友评论

          本文标题:Javadoc归类

          本文链接:https://www.haomeiwen.com/subject/wiprgttx.html