-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
49 lines (41 loc) · 809 Bytes
/
types.go
File metadata and controls
49 lines (41 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Copyright (c) 2022, arivum.
* All rights reserved.
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
package json2msgpackStreamer
import (
"bufio"
"io"
)
const (
bufsize = 4 << 10
)
type blockInsertion struct {
buf []byte
pos int
}
type blockbuf struct {
first *block
current *block
}
type block struct {
next *block
buf [bufsize]byte
index int
insertions []*blockInsertion
}
type blockBufPos struct {
block *block
index int
}
type JSON2MsgPackStreamer struct {
r *bufio.Reader
pipeR *io.PipeReader
pipeW *io.PipeWriter
underlayingReader io.Reader
buf *blockbuf
nextByte byte
lastError error
}