62
edits
| m (Added a link to the corresponding discussion and organized the headings.) |  (→ByteString:  use definition list for constructors) | ||
| Line 17: | Line 17: | ||
| A ByteString is an immutable, fixed-width representation of a C unsigned char (byte) array.  ByteString supports the String API, and indexing returns a byte substring of length 1. | A ByteString is an immutable, fixed-width representation of a C unsigned char (byte) array.  ByteString supports the String API, and indexing returns a byte substring of length 1. | ||
| The ByteString constructor  | The ByteString constructor: | ||
| ; ByteString() | |||
| : Construct an empty byte string. | |||
| ; ByteString(byteString) | |||
| : Copies byteString. | |||
| ; ByteString(byteArray) | |||
| : Use the contents of byteArray. | |||
| ; ByteString(arrayOfNumbers) | |||
| : Use the numbers in arrayOfNumbers as the bytes. | |||
| : If any element is outside the range 0...255, an exception (''TODO'') is thrown. | |||
| ; ByteString(string, codec) | |||
| : Convert a string. The ByteString will contain string encoded with codec. | |||
| ByteString instances support the following: | ByteString instances support the following: | ||
| Line 60: | Line 66: | ||
| ByteString does not implement toUpperCase() or toLowerCase() since they are not meaningful without the context of a codec. | ByteString does not implement toUpperCase() or toLowerCase() since they are not meaningful without the context of a codec. | ||
| == ByteArray == | == ByteArray == | ||
edits