MCPcopy Create free account
hub / github.com/blues/note / binAppendInt16

Method binAppendInt16

lib/bulk.go:1308–1318  ·  view source on GitHub ↗
(ctx context.Context, value int16)

Source from the content-addressed store, hash-verified

1306}
1307
1308func (tmplContext *BulkTemplateContext) binAppendInt16(ctx context.Context, value int16) (err error) {
1309 if debugEncoding {
1310 logDebug(ctx, "append %d INT16 = %d", tmplContext.binDepth, value)
1311 }
1312 err = tmplContext.binAppendUint8(ctx, uint8(value&0xff))
1313 value = value >> 8
1314 if err == nil {
1315 err = tmplContext.binAppendUint8(ctx, uint8(value&0xff))
1316 }
1317 return err
1318}
1319func (tmplContext *BulkTemplateContext) binAppendUint16(ctx context.Context, value uint16) (err error) {
1320 if debugEncoding {
1321 logDebug(ctx, "append %d UINT16 = %d", tmplContext.binDepth, value)

Callers 2

BulkEncodeNextEntryMethod · 0.95
processTemplateValueMethod · 0.95

Calls 2

binAppendUint8Method · 0.95
logDebugFunction · 0.85

Tested by

no test coverage detected