File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ cdef class WriteBuffer:
39
39
cdef write_buffer(self , WriteBuffer buf)
40
40
cdef write_byte(self , char b)
41
41
cdef write_bytes(self , bytes data)
42
+ cdef write_len_prefixed_buffer(self , WriteBuffer buf)
42
43
cdef write_len_prefixed_bytes(self , bytes data)
43
44
cdef write_bytestring(self , bytes string)
44
45
cdef write_str(self , str string, str encoding)
Original file line number Diff line number Diff line change @@ -151,8 +151,13 @@ cdef class WriteBuffer:
151
151
cdef write_str(self , str string, str encoding):
152
152
self .write_bytestring(string.encode(encoding))
153
153
154
+ cdef write_len_prefixed_buffer(self , WriteBuffer buf):
155
+ # Write a length-prefixed (not NULL-terminated) bytes sequence.
156
+ self .write_int32(< int32_t> buf.len())
157
+ self .write_buffer(buf)
158
+
154
159
cdef write_len_prefixed_bytes(self , bytes data):
155
- # Write a length-prefixed (not NULL-terminated) UTF-8 string .
160
+ # Write a length-prefixed (not NULL-terminated) bytes sequence .
156
161
cdef:
157
162
char * buf
158
163
ssize_t size
You can’t perform that action at this time.
0 commit comments