MCPcopy Create free account
hub / github.com/google/gapid / utf16EncodeStringPoolEntry

Function utf16EncodeStringPoolEntry

core/os/android/binaryxml/string_pool.go:117–127  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

115func (stringPool) xml(*xmlContext) string { return "" }
116
117func utf16EncodeStringPoolEntry(str string) []byte {
118 var b bytes.Buffer
119 w := endian.Writer(&b, device.LittleEndian)
120 runes := utf16.Encode([]rune(str))
121 encodeLength(w, uint32(len(runes)))
122 for _, rune := range runes {
123 w.Uint16(rune)
124 }
125 w.Uint16(0) /* bin_xml.py says so */
126 return b.Bytes()
127}
128
129func (c *stringPool) encode() []byte {
130 if len(c.styles) > 0 {

Callers 1

encodeMethod · 0.85

Calls 4

encodeLengthFunction · 0.85
WriterMethod · 0.80
EncodeMethod · 0.65
Uint16Method · 0.65

Tested by

no test coverage detected