MCPcopy Index your code
hub / github.com/Textualize/textual / decode_bytes

Function decode_bytes

src/textual/_binary_encode.py:240–249  ·  view source on GitHub ↗

Decode a bytes string from the encoded data. Returns: A bytes object.

(size_bytes: bytes)

Source from the content-addressed store, hash-verified

238 return int(int_bytes)
239
240 def decode_bytes(size_bytes: bytes) -> bytes:
241 """Decode a bytes string from the encoded data.
242
243 Returns:
244 A bytes object.
245 """
246 while (byte := get_byte()) != b":":
247 size_bytes += byte
248 bytes_string = get_bytes(int(size_bytes))
249 return bytes_string
250
251 def decode_string() -> str:
252 """Decode a (utf-8 encoded) string from the encoded data.

Callers 1

decodeFunction · 0.85

Calls 2

get_byteFunction · 0.85
get_bytesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…