MCPcopy Create free account
hub / github.com/Allenxuxu/ringbuffer / WriteString

Method WriteString

ring_buffer.go:366–370  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

364}
365
366func (r *RingBuffer) WriteString(s string) (n int, err error) {
367 x := (*[2]uintptr)(unsafe.Pointer(&s))
368 h := [3]uintptr{x[0], x[1], x[1]}
369 return r.Write(*(*[]byte)(unsafe.Pointer(&h)))
370}
371
372// Bytes 返回所有可读数据,此操作不会移动读指针,仅仅是拷贝全部数据
373func (r *RingBuffer) Bytes() (buf []byte) {

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.95

Tested by

no test coverage detected