| write data/Data from/int= to/int= --break-length/int= --flush/bool= -> int | |
|---|---|
| try-write data/Data from/int= to/int= --break-length/int= --flush/bool= -> int | Tries to write the given data to this writer. |
| flush -> none | |
| operator == other/any -> bool | Whether this object is equal to the other. |
| stringify -> string | Stringifies this object. |
| processed -> int | The amount of bytes that have been written to this writer so far. |
| write-byte value/int --flush/bool= -> none | Writes a single byte. |
| write-from reader/Reader --flush/bool= -> none | Writes all data that is provided by the given reader. |
| little-endian -> EndianWriter | Provides endian-aware functions to write to this instance. |
| big-endian -> EndianWriter | Provides endian-aware functions to write to this instance. |
import io
main:
buffer := io.Buffer
buffer.big-endian.write-int32 0x12345678
// The most significant byte 0x12 is at index 0.
print buffer.bytes // => #[0x12, 0x34, 0x56, 0x78]
import io
main:
buffer := io.Buffer // A writer.
buffer.little-endian.write-int32 0x12345678
// The least significant byte 0x78 is at index 0.
print buffer.bytes // => #[0x78, 0x56, 0x34, 0x12]
class Pin:
number/int
constructor .number:
operator == other:
if other is not Pin: return false
return number == other.number
hash-code method. That is, if a class has a hash-code member, then the equality and hash-code must agree. If two instances are equal (a == b), then their hash codes must also be equal (a.hash-code == b.hash-code).
for position := 0; position < data.byte-size; null:
position += my-uart.write (data.byte-slice position data.byte-size)