5This Encoder shares a lot in common with protobufs. It uses variable length
6ints and size-encoded strings
and binary values. Other than being hugely
7stripped down, the major conceptual difference
is that this encoding
8is UTF8
"safe". This means that it generates a form that should be passed
9on the wire
as UTF8
and then can be very efficiently decoded by JS
in the
10browser which natively handles these kinds of strings. To stay efficient
in
11this range, all numeric data
is encoded
in only 7 bits.
23 '''Uses a 7-bit per byte encoding to stay UTF-8 "safe".'''
41 '''Encode binary data using base64. This is less efficient than a 7-bit
42 encoding would be; however, it can be decoded much faster on most
43 browsers due to native support
for the format.
'''
44 v = base64.b64encode(s)
58 return _encVarInt(
len(d)) + d
def writeInt(self, value)
static void append(char **dst, size_t *count, const char *src, size_t n)
static SkString join(const CommandLineFlags::StringArray &)