Files
ladybird/AK
asynts 31bb107922 AK: Remove BufferStream class.
There are three classes avaliable that share the functionality of
BufferStream:

 1. InputMemoryStream is for reading from static buffers. Example:

        Bytes input = /* ... */;
        InputMemoryStream stream { input };

        LittleEndian<u32> little_endian_value;
        input >> little_endian_value;

        u32 host_endian_value;
        input >> host_endian_value;

        SomeComplexStruct complex_struct;
        input >> Bytes { &complex_struct, sizeof(complex_struct) };

 2. OutputMemoryStream is for writing to static buffers. Example:

        Array<u8, 4096> buffer;
        OutputMemoryStream stream;

        stream << LittleEndian<u32> { 42 };
        stream << ReadonlyBytes { &complex_struct, sizeof(complex_struct) };

        foo(stream.bytes());

 3. DuplexMemoryStream for writing to dynamic buffers, can also be used
    as an intermediate buffer by reading from it directly. Example:

        DuplexMemoryStream stream;

        stream << NetworkOrdered<u32> { 13 };
        stream << NetowkrOrdered<u64> { 22 };

        NetworkOrdered<u32> value;
        stream >> value;
        ASSERT(value == 13);

        foo(stream.copy_into_contiguous_buffer());

Unlike BufferStream these streams do not use a fixed endianness
(BufferStream used little endian) these have to be explicitly specified.
There are helper types in <AK/Endian.h>.
2020-09-21 09:37:49 +02:00
..
2020-09-08 14:01:21 +02:00
2020-08-26 00:55:13 +02:00
2020-09-21 09:37:49 +02:00
2020-09-06 16:09:09 +02:00
2020-06-13 12:43:22 +02:00
2020-08-22 20:55:10 +02:00
2020-07-15 20:16:38 +02:00
2020-08-30 09:56:10 +02:00
2020-02-25 14:55:04 +01:00
2020-07-23 23:02:28 +02:00
2020-07-23 23:02:28 +02:00
2020-08-16 16:33:28 +02:00