@@ -955,28 +955,35 @@ msgid ""
955
955
"`BufferedIOBase` deals with. This is not part of the :class:"
956
956
"`BufferedIOBase` API and may not exist on some implementations."
957
957
msgstr ""
958
+ "底層的原始串流(一個 :class:`RawIOBase` 實例),:class:`BufferedIOBase` 處理"
959
+ "的對象。這不是 :class:`BufferedIOBase` API 的一部分,且在某些實作可能不存在。"
958
960
959
961
#: ../../library/io.rst:552
960
962
msgid "Separate the underlying raw stream from the buffer and return it."
961
- msgstr ""
963
+ msgstr "將底層的原始串流從緩衝區中分離出來,並回傳它。 "
962
964
963
965
#: ../../library/io.rst:554
964
966
msgid ""
965
967
"After the raw stream has been detached, the buffer is in an unusable state."
966
- msgstr ""
968
+ msgstr "在原始串流被分離後,緩衝區處於一個不可用的狀態。 "
967
969
968
970
#: ../../library/io.rst:557
969
971
msgid ""
970
972
"Some buffers, like :class:`BytesIO`, do not have the concept of a single raw "
971
973
"stream to return from this method. They raise :exc:`UnsupportedOperation`."
972
974
msgstr ""
975
+ "某些緩衝區,如 :class:`BytesIO`,沒有單一原始串流的概念可從此方法回傳。它們會"
976
+ "引發 :exc:`UnsupportedOperation`。"
973
977
974
978
#: ../../library/io.rst:565
975
979
msgid ""
976
980
"Read and return up to *size* bytes. If the argument is omitted, ``None``, "
977
981
"or negative, data is read and returned until EOF is reached. An empty :"
978
982
"class:`bytes` object is returned if the stream is already at EOF."
979
983
msgstr ""
984
+ "讀取並回傳最多 *size* 個位元組。如果引數被省略、為 ``None`` 或為負值,將讀取"
985
+ "並回傳資料直到達到 EOF 為止。如果串流已經處於 EOF,則回傳一個空的 :class:"
986
+ "`bytes` 物件。"
980
987
981
988
#: ../../library/io.rst:569
982
989
msgid ""
@@ -986,12 +993,17 @@ msgid ""
986
993
"raw read will be issued, and a short result does not imply that EOF is "
987
994
"imminent."
988
995
msgstr ""
996
+ "如果引數為正數,且底層原始串流不是互動式的,可能會發出多次原始讀取來滿足位元"
997
+ "組數量(除非首先達到 EOF)。但對於互動式原始串流,最多只會發出一次原始讀取,"
998
+ "且短少的資料不表示 EOF 即將到來。"
989
999
990
1000
#: ../../library/io.rst:575 ../../library/io.rst:598 ../../library/io.rst:608
991
1001
msgid ""
992
1002
"A :exc:`BlockingIOError` is raised if the underlying raw stream is in non "
993
1003
"blocking-mode, and has no data available at the moment."
994
1004
msgstr ""
1005
+ "如果底層原始串流處於非阻塞模式,且當前沒有可用資料,則會引發 :exc:"
1006
+ "`BlockingIOError`。"
995
1007
996
1008
#: ../../library/io.rst:580
997
1009
msgid ""
@@ -1000,25 +1012,34 @@ msgid ""
1000
1012
"method. This can be useful if you are implementing your own buffering on "
1001
1013
"top of a :class:`BufferedIOBase` object."
1002
1014
msgstr ""
1015
+ "讀取並回傳最多 *size* 個位元組,最多呼叫一次底層原始串流的 :meth:`~RawIOBase."
1016
+ "read` (或 :meth:`~RawIOBase.readinto`) 方法。如果你正在 :class:"
1017
+ "`BufferedIOBase` 物件之上實作自己的緩衝區,這可能會很有用。"
1003
1018
1004
1019
#: ../../library/io.rst:586
1005
1020
msgid ""
1006
1021
"If *size* is ``-1`` (the default), an arbitrary number of bytes are returned "
1007
1022
"(more than zero unless EOF is reached)."
1008
1023
msgstr ""
1024
+ "如果 *size* 為 ``-1`` (預設值),則會回傳任意數量的位元組(除非達到 EOF,否"
1025
+ "則會超過零)。"
1009
1026
1010
1027
#: ../../library/io.rst:591
1011
1028
msgid ""
1012
1029
"Read bytes into a pre-allocated, writable :term:`bytes-like object` *b* and "
1013
1030
"return the number of bytes read. For example, *b* might be a :class:"
1014
1031
"`bytearray`."
1015
1032
msgstr ""
1033
+ "讀取位元組到一個預先分配的、可寫的 :term:`bytes-like object` *b* 當中,並回傳"
1034
+ "讀取的位元組數量。例如,*b* 可能是一個 :class:`bytearray`。"
1016
1035
1017
1036
#: ../../library/io.rst:595
1018
1037
msgid ""
1019
1038
"Like :meth:`read`, multiple reads may be issued to the underlying raw "
1020
1039
"stream, unless the latter is interactive."
1021
1040
msgstr ""
1041
+ "類似於 :meth:`read`,除非後者是互動式的,否則可能會對底層原始串流發出多次讀"
1042
+ "取。"
1022
1043
1023
1044
#: ../../library/io.rst:603
1024
1045
msgid ""
@@ -1027,6 +1048,9 @@ msgid ""
1027
1048
"read` (or :meth:`~RawIOBase.readinto`) method. Return the number of bytes "
1028
1049
"read."
1029
1050
msgstr ""
1051
+ "讀取位元組到一個預先分配的、可寫的 :term:`bytes-like object` *b* 中,最多呼叫"
1052
+ "一次底層原始串流的 :meth:`~RawIOBase.read` (或 :meth:`~RawIOBase.readinto`)"
1053
+ "方法。此方法回傳讀取的位元組數量。"
1030
1054
1031
1055
#: ../../library/io.rst:615
1032
1056
msgid ""
@@ -1036,19 +1060,27 @@ msgid ""
1036
1060
"implementation, these bytes may be readily written to the underlying stream, "
1037
1061
"or held in a buffer for performance and latency reasons."
1038
1062
msgstr ""
1063
+ "寫入給定的 :term:`bytes-like object`,*b*,並回傳寫入的位元組數量(總是等於 "
1064
+ "*b* 的長度,以位元組計,因為如果寫入失敗將會引發 :exc:`OSError`)。根據實際的"
1065
+ "實作,這些位元組可能會立即寫入底層串流,或出於性能和延遲的緣故而被留在緩衝區"
1066
+ "當中。"
1039
1067
1040
1068
#: ../../library/io.rst:622
1041
1069
msgid ""
1042
1070
"When in non-blocking mode, a :exc:`BlockingIOError` is raised if the data "
1043
1071
"needed to be written to the raw stream but it couldn't accept all the data "
1044
1072
"without blocking."
1045
1073
msgstr ""
1074
+ "當處於非阻塞模式時,如果需要將資料寫入原始串流,但它無法接受所有資料而不阻"
1075
+ "塞,則會引發 :exc:`BlockingIOError`。"
1046
1076
1047
1077
#: ../../library/io.rst:626
1048
1078
msgid ""
1049
1079
"The caller may release or mutate *b* after this method returns, so the "
1050
1080
"implementation should only access *b* during the method call."
1051
1081
msgstr ""
1082
+ "呼叫者可以在此方法回傳後釋放或變更 *b*,因此實作應該僅在方法呼叫期間存取 "
1083
+ "*b*。"
1052
1084
1053
1085
#: ../../library/io.rst:631
1054
1086
msgid "Raw File I/O"
0 commit comments