Copyright 2017, OpenCensus Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package tagencoding contains the tag encoding used interally by the stats collector.
package tagencoding // import "go.opencensus.io/internal/tagencoding"
Values represent the encoded buffer for the values.
type Values struct {
	Buffer     []byte
	WriteIndex int
	ReadIndex  int
}

func ( *Values) ( int) {
	if len(.Buffer)-.WriteIndex <  {
		 := make([]byte, 2*(len(.Buffer)+1)+)
		copy(, .Buffer)
		.Buffer = 
	}
}
WriteValue is the helper method to encode Values from map[Key][]byte.
func ( *Values) ( []byte) {
	 := len() & 0xff
	.growIfRequired(1 + )
writing length of v
	.Buffer[.WriteIndex] = byte()
	.WriteIndex++

No value was encoded for this key
		return
	}
writing v
	copy(.Buffer[.WriteIndex:], [:])
	.WriteIndex += 
}
ReadValue is the helper method to decode Values to a map[Key][]byte.
read length of v
	 := int(.Buffer[.ReadIndex])
	.ReadIndex++
No value was encoded for this key
		return nil
	}
read value of v
	 := make([]byte, )
	 := .ReadIndex + 
	copy(, .Buffer[.ReadIndex:])
	.ReadIndex = 
	return 
}
Bytes returns a reference to already written bytes in the Buffer.
func ( *Values) () []byte {
	return .Buffer[:.WriteIndex]