You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-15 22:50:24 +02:00
write float 32
This commit is contained in:
18
stream.go
18
stream.go
@ -104,7 +104,7 @@ func (b *Stream) Flush() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Stream) WriteString(s string) {
|
||||
func (b *Stream) WriteRaw(s string) {
|
||||
for len(s) > b.Available() && b.Error == nil {
|
||||
n := copy(b.buf[b.n:], s)
|
||||
b.n += n
|
||||
@ -118,6 +118,22 @@ func (b *Stream) WriteString(s string) {
|
||||
b.n += n
|
||||
}
|
||||
|
||||
func (b *Stream) WriteString(s string) {
|
||||
b.writeByte('"')
|
||||
for len(s) > b.Available() && b.Error == nil {
|
||||
n := copy(b.buf[b.n:], s)
|
||||
b.n += n
|
||||
s = s[n:]
|
||||
b.Flush()
|
||||
}
|
||||
if b.Error != nil {
|
||||
return
|
||||
}
|
||||
n := copy(b.buf[b.n:], s)
|
||||
b.n += n
|
||||
b.writeByte('"')
|
||||
}
|
||||
|
||||
func (stream *Stream) WriteNull() {
|
||||
stream.Write(bytesNull)
|
||||
}
|
||||
|
Reference in New Issue
Block a user