Similar to AK::DuplexStream, this writes to the end and reads from the beginning of a dynamically allocated buffer.