BulkStrings are always used to send messages to the server. Thus, this
class is not only used when materializing messages as explicit
RespValue
s, but also as the argument accepted by Redis.exec
. Hence, for
performance reasons, it is split into the following hierarchy:
- This class, which describes the minimal behaviour needed to send data to Redis but does not specify where the data comes from.
- A specialized class
ArrayBulkString
which is backed by a byte array and used when receiving data from Redis.
This separation allows some methods to treat the array-backed instance specially and use the array directly instead of copying memory.
https://redis.io/docs/reference/protocol-spec/#resp-bulk-strings
- Companion:
- object