• Summary of java stream classes


    Java’s stream classes are good for streaming sequences of bytes, but
    they’re not good for streaming sequences of characters because bytes and
    characters are two different things. A byte represents an 8-bit data item
    and a character represents a 16-bit data item. Also, Java’s char and String
    types naturally handle characters instead of bytes. More importantly, byte
    streams have no knowledge of character sets and their encodings.
    Java provides writer and reader classes to stream characters. They support
    character I/O (they work with char instead of byte) and take character
    encodings into account. The abstract Writer and Reader classes describe
    what it means to be a writer and a reader.
    Writer and Reader are subclassed by OutputStreamWriter and
    InputStreamReader, which bridge the gap between character and byte
    streams. These classes are subclassed by the FileWriter and FileReader
    convenience classes, which facilitate writing/reading characters to/from
    files. Writer and Reader are also subclassed by BufferedWriter and
    BufferedReader, which buffer characters for efficiency.
  • 相关阅读:
    cordova插件(一)-inappbrowser
    quartz框架(一)-入门使用
    gitbook联动github
    系统服务部署入门
    websocket深入研究
    日志组件-logback入门
    nginx专题-nginx入门
    springmvc使用websocket入门
    基于cordova的混合app开发
    C语言------指针
  • 原文地址:https://www.cnblogs.com/rojas/p/5408397.html
Copyright © 2020-2023  润新知