Example #1
0
func (bs *BytesStore) forwardReader() BytesReader {
	if len(bs.blocks) == 1 {
		return newForwardBytesReader(bs.blocks[0])
	}
	ans := &BytesStoreForwardReader{owner: bs, nextRead: bs.blockSize}
	ans.DataInputImpl = util.NewDataInput(ans)
	return ans
}
Example #2
0
func newByteSliceReader() *ByteSliceReader {
	ans := new(ByteSliceReader)
	ans.DataInputImpl = util.NewDataInput(ans)
	return ans
}
Example #3
0
func newReverseBytesReader(bytes []byte) BytesReader {
	ans := &ReverseBytesReader{bytes: bytes}
	ans.DataInputImpl = util.NewDataInput(ans)
	return ans
}
Example #4
0
func newForwardBytesReader(bytes []byte) BytesReader {
	ans := &ForwardBytesReader{bytes: bytes}
	ans.DataInputImpl = util.NewDataInput(ans)
	return ans
}
Example #5
0
func newBytesStoreReverseReader(owner *BytesStore, current []byte) *BytesStoreReverseReader {
	ans := &BytesStoreReverseReader{owner: owner, current: current, nextBuffer: -1}
	ans.DataInputImpl = util.NewDataInput(ans)
	return ans
}
Example #6
0
func NewEmptyByteArrayDataInput() *ByteArrayDataInput {
	ans := &ByteArrayDataInput{}
	ans.DataInputImpl = util.NewDataInput(ans)
	ans.Reset(make([]byte, 0))
	return ans
}
Example #7
0
func NewByteArrayDataInput(bytes []byte) *ByteArrayDataInput {
	ans := &ByteArrayDataInput{}
	ans.DataInputImpl = util.NewDataInput(ans)
	ans.Reset(bytes)
	return ans
}