二進位資料服務
**************

本章所描述的模組提供了一些基本的二進位資料操作服務。而針對二進位資料的
其他操作──尤其是關於檔案格式和網路協定的部分──則會在相關章節中詳細描述
。

一些在 文本處理 (Text Processing) 服務 中提及的函式庫也可處理 ASCII 相
容的二進位格式（例如，"re"）及所有的二進位資料（例如，"difflib"）。

此外，請參閱 Python 內建的二進位資料類型的文件，詳情請參考 Binary
Sequence Types --- bytes, bytearray, memoryview。

* "struct" --- 將位元組直譯為打包起來的二進位資料

  * 函式與例外

    * "error"

    * "pack()"

    * "pack_into()"

    * "unpack()"

    * "unpack_from()"

    * "iter_unpack()"

    * "calcsize()"

  * Format Strings

    * Byte Order, Size, and Alignment

    * Format Characters

    * 範例

  * Applications

    * Native Formats

    * Standard Formats

  * Classes

    * "Struct"

      * "pack()"

      * "pack_into()"

      * "unpack()"

      * "unpack_from()"

      * "iter_unpack()"

      * "format"

      * "size"

* "codecs" --- 編解碼器註冊表和基底類別

  * "encode()"

  * "decode()"

  * "lookup()"

  * "CodecInfo"

    * "name"

    * "encode"

    * "decode"

    * "incrementalencoder"

    * "incrementaldecoder"

    * "streamwriter"

    * "streamreader"

  * "getencoder()"

  * "getdecoder()"

  * "getincrementalencoder()"

  * "getincrementaldecoder()"

  * "getreader()"

  * "getwriter()"

  * "register()"

  * "unregister()"

  * "open()"

  * "EncodedFile()"

  * "iterencode()"

  * "iterdecode()"

  * "BOM"

  * "BOM_BE"

  * "BOM_LE"

  * "BOM_UTF8"

  * "BOM_UTF16"

  * "BOM_UTF16_BE"

  * "BOM_UTF16_LE"

  * "BOM_UTF32"

  * "BOM_UTF32_BE"

  * "BOM_UTF32_LE"

  * Codec Base Classes

    * Error Handlers

      * "register_error()"

      * "lookup_error()"

      * "strict_errors()"

      * "ignore_errors()"

      * "replace_errors()"

      * "backslashreplace_errors()"

      * "xmlcharrefreplace_errors()"

      * "namereplace_errors()"

    * Stateless Encoding and Decoding

      * "Codec"

        * "encode()"

        * "decode()"

    * Incremental Encoding and Decoding

      * IncrementalEncoder 物件

        * "IncrementalEncoder"

          * "encode()"

          * "reset()"

          * "getstate()"

          * "setstate()"

      * IncrementalDecoder 物件

        * "IncrementalDecoder"

          * "decode()"

          * "reset()"

          * "getstate()"

          * "setstate()"

    * Stream Encoding and Decoding

      * StreamWriter 物件

        * "StreamWriter"

          * "write()"

          * "writelines()"

          * "reset()"

      * StreamReader 物件

        * "StreamReader"

          * "read()"

          * "readline()"

          * "readlines()"

          * "reset()"

      * StreamReaderWriter 物件

        * "StreamReaderWriter"

      * StreamRecoder 物件

        * "StreamRecoder"

  * Encodings and Unicode

  * Standard Encodings

  * Python Specific Encodings

    * Text Encodings

    * Binary Transforms

    * Text Transforms

  * "encodings.idna" --- Internationalized Domain Names in
    Applications

    * "nameprep()"

    * "ToASCII()"

    * "ToUnicode()"

  * "encodings.mbcs" --- Windows ANSI codepage

  * "encodings.utf_8_sig" --- UTF-8 codec with BOM signature
