MCPcopy
hub / github.com/PokemonGoF/PokemonGo-Bot / writeString

Function writeString

map-chat/javascript/browserMqtt.js:1953–1960  ·  view source on GitHub ↗

* writeString - write a utf8 string to the buffer * * @param buffer - destination * @param pos - offset * @param string - string to write * @return number of bytes written * * @api private

(buffer, pos, string)

Source from the content-addressed store, hash-verified

1951 */
1952
1953function writeString(buffer, pos, string) {
1954 var strlen = Buffer.byteLength(string)
1955 writeNumber(buffer, pos, strlen)
1956
1957 writeStringNoPos(buffer, pos + 2, string)
1958
1959 return strlen + 2
1960}
1961
1962function writeStringNoPos(buffer, pos, string) {
1963 buffer.write(string, pos)

Callers 4

connectFunction · 0.85
subscribeFunction · 0.85
unsubscribeFunction · 0.85
writeStringOrBufferFunction · 0.85

Calls 2

writeNumberFunction · 0.85
writeStringNoPosFunction · 0.85

Tested by

no test coverage detected