62
edits
m (→Alternative: Converter: explain that it is probably faster) |
(→Alternative: Converter: add outputByteArray parameter for further efficiency) |
||
| Line 75: | Line 75: | ||
; [Constructor] Converter(from, to) | ; [Constructor] Converter(from, to) | ||
: Where from and to are the encoding names. | : Where from and to are the encoding names. | ||
; [Method] push(byteStringOrArray) | ; [Method] push(byteStringOrArray[, outputByteArray]) | ||
: Convert input from a ByteString or ByteArray. | : Convert input from a ByteString or ByteArray. Those parts of byteStringOrArray that could not be converted (for multi-byte encodings) are stored in a buffer. If outputByteArray is passed, the results are ''appended'' to outputByteArray. | ||
: | : If outputByteArray was passed, returns outputByteArray, otherwise returns (as a ByteString) as much output as could be converted. | ||
; [Method] close() | ; [Method] close() | ||
: Close the stream. Throws an exception if there was a conversion error (specifically, a partial multibyte character). | : Close the stream. Throws an exception if there was a conversion error (specifically, a partial multibyte character). | ||
edits