MCPcopy Create free account
hub / github.com/antchfx/xmlquery / Read

Method Read

cached_reader.go:56–69  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

54}
55
56func (c *cachedReader) Read(p []byte) (int, error) {
57 n, err := c.buffer.Read(p)
58 if err != nil {
59 return n, err
60 }
61 if c.caching {
62 for i := 0; i < n; i++ {
63 if !c.cacheByte(p[i]) {
64 break
65 }
66 }
67 }
68 return n, err
69}
70
71func (c *cachedReader) cacheByte(b byte) bool {
72 n := len(c.cache)

Callers

nothing calls this directly

Calls 1

cacheByteMethod · 0.95

Tested by

no test coverage detected