@@ -955,28 +955,35 @@ msgid ""
955955"`BufferedIOBase` deals with. This is not part of the :class:"
956956"`BufferedIOBase` API and may not exist on some implementations."
957957msgstr ""
958+ "底層的原始串流(一個 :class:`RawIOBase` 實例),:class:`BufferedIOBase` 處理"
959+ "的對象。這不是 :class:`BufferedIOBase` API 的一部分,且在某些實作可能不存在。"
958960
959961#: ../../library/io.rst:552
960962msgid "Separate the underlying raw stream from the buffer and return it."
961- msgstr ""
963+ msgstr "將底層的原始串流從緩衝區中分離出來,並回傳它。 "
962964
963965#: ../../library/io.rst:554
964966msgid ""
965967"After the raw stream has been detached, the buffer is in an unusable state."
966- msgstr ""
968+ msgstr "在原始串流被分離後,緩衝區處於一個不可用的狀態。 "
967969
968970#: ../../library/io.rst:557
969971msgid ""
970972"Some buffers, like :class:`BytesIO`, do not have the concept of a single raw "
971973"stream to return from this method. They raise :exc:`UnsupportedOperation`."
972974msgstr ""
975+ "某些緩衝區,如 :class:`BytesIO`,沒有單一原始串流的概念可從此方法回傳。它們會"
976+ "引發 :exc:`UnsupportedOperation`。"
973977
974978#: ../../library/io.rst:565
975979msgid ""
976980"Read and return up to *size* bytes. If the argument is omitted, ``None``, "
977981"or negative, data is read and returned until EOF is reached. An empty :"
978982"class:`bytes` object is returned if the stream is already at EOF."
979983msgstr ""
984+ "讀取並回傳最多 *size* 個位元組。如果引數被省略、為 ``None`` 或為負值,將讀取"
985+ "並回傳資料直到達到 EOF 為止。如果串流已經處於 EOF,則回傳一個空的 :class:"
986+ "`bytes` 物件。"
980987
981988#: ../../library/io.rst:569
982989msgid ""
@@ -986,12 +993,17 @@ msgid ""
986993"raw read will be issued, and a short result does not imply that EOF is "
987994"imminent."
988995msgstr ""
996+ "如果引數為正數,且底層原始串流不是互動式的,可能會發出多次原始讀取來滿足位元"
997+ "組數量(除非首先達到 EOF)。但對於互動式原始串流,最多只會發出一次原始讀取,"
998+ "且短少的資料不表示 EOF 即將到來。"
989999
9901000#: ../../library/io.rst:575 ../../library/io.rst:598 ../../library/io.rst:608
9911001msgid ""
9921002"A :exc:`BlockingIOError` is raised if the underlying raw stream is in non "
9931003"blocking-mode, and has no data available at the moment."
9941004msgstr ""
1005+ "如果底層原始串流處於非阻塞模式,且當前沒有可用資料,則會引發 :exc:"
1006+ "`BlockingIOError`。"
9951007
9961008#: ../../library/io.rst:580
9971009msgid ""
@@ -1000,25 +1012,34 @@ msgid ""
10001012"method. This can be useful if you are implementing your own buffering on "
10011013"top of a :class:`BufferedIOBase` object."
10021014msgstr ""
1015+ "讀取並回傳最多 *size* 個位元組,最多呼叫一次底層原始串流的 :meth:`~RawIOBase."
1016+ "read` (或 :meth:`~RawIOBase.readinto`) 方法。如果你正在 :class:"
1017+ "`BufferedIOBase` 物件之上實作自己的緩衝區,這可能會很有用。"
10031018
10041019#: ../../library/io.rst:586
10051020msgid ""
10061021"If *size* is ``-1`` (the default), an arbitrary number of bytes are returned "
10071022"(more than zero unless EOF is reached)."
10081023msgstr ""
1024+ "如果 *size* 為 ``-1`` (預設值),則會回傳任意數量的位元組(除非達到 EOF,否"
1025+ "則會超過零)。"
10091026
10101027#: ../../library/io.rst:591
10111028msgid ""
10121029"Read bytes into a pre-allocated, writable :term:`bytes-like object` *b* and "
10131030"return the number of bytes read. For example, *b* might be a :class:"
10141031"`bytearray`."
10151032msgstr ""
1033+ "讀取位元組到一個預先分配的、可寫的 :term:`bytes-like object` *b* 當中,並回傳"
1034+ "讀取的位元組數量。例如,*b* 可能是一個 :class:`bytearray`。"
10161035
10171036#: ../../library/io.rst:595
10181037msgid ""
10191038"Like :meth:`read`, multiple reads may be issued to the underlying raw "
10201039"stream, unless the latter is interactive."
10211040msgstr ""
1041+ "類似於 :meth:`read`,除非後者是互動式的,否則可能會對底層原始串流發出多次讀"
1042+ "取。"
10221043
10231044#: ../../library/io.rst:603
10241045msgid ""
@@ -1027,6 +1048,9 @@ msgid ""
10271048"read` (or :meth:`~RawIOBase.readinto`) method. Return the number of bytes "
10281049"read."
10291050msgstr ""
1051+ "讀取位元組到一個預先分配的、可寫的 :term:`bytes-like object` *b* 中,最多呼叫"
1052+ "一次底層原始串流的 :meth:`~RawIOBase.read` (或 :meth:`~RawIOBase.readinto`)"
1053+ "方法。此方法回傳讀取的位元組數量。"
10301054
10311055#: ../../library/io.rst:615
10321056msgid ""
@@ -1036,19 +1060,27 @@ msgid ""
10361060"implementation, these bytes may be readily written to the underlying stream, "
10371061"or held in a buffer for performance and latency reasons."
10381062msgstr ""
1063+ "寫入給定的 :term:`bytes-like object`,*b*,並回傳寫入的位元組數量(總是等於 "
1064+ "*b* 的長度,以位元組計,因為如果寫入失敗將會引發 :exc:`OSError`)。根據實際的"
1065+ "實作,這些位元組可能會立即寫入底層串流,或出於性能和延遲的緣故而被留在緩衝區"
1066+ "當中。"
10391067
10401068#: ../../library/io.rst:622
10411069msgid ""
10421070"When in non-blocking mode, a :exc:`BlockingIOError` is raised if the data "
10431071"needed to be written to the raw stream but it couldn't accept all the data "
10441072"without blocking."
10451073msgstr ""
1074+ "當處於非阻塞模式時,如果需要將資料寫入原始串流,但它無法接受所有資料而不阻"
1075+ "塞,則會引發 :exc:`BlockingIOError`。"
10461076
10471077#: ../../library/io.rst:626
10481078msgid ""
10491079"The caller may release or mutate *b* after this method returns, so the "
10501080"implementation should only access *b* during the method call."
10511081msgstr ""
1082+ "呼叫者可以在此方法回傳後釋放或變更 *b*,因此實作應該僅在方法呼叫期間存取 "
1083+ "*b*。"
10521084
10531085#: ../../library/io.rst:631
10541086msgid "Raw File I/O"
0 commit comments