@@ -600,6 +600,9 @@ func stringToInt(b []byte) int {
600
600
return val
601
601
}
602
602
603
+ // returns the string read as a bytes slice, wheter the value is NULL,
604
+ // the number of bytes read and an error, in case the string is longer than
605
+ // the input slice
603
606
func readLengthEnodedString (b []byte ) ([]byte , bool , int , error ) {
604
607
// Get length
605
608
num , isNull , n := readLengthEncodedInteger (b )
@@ -616,6 +619,8 @@ func readLengthEnodedString(b []byte) ([]byte, bool, int, error) {
616
619
return nil , false , n , io .EOF
617
620
}
618
621
622
+ // returns the number of bytes skipped and an error, in case the string is
623
+ // longer than the input slice
619
624
func skipLengthEnodedString (b []byte ) (int , error ) {
620
625
// Get length
621
626
num , _ , n := readLengthEncodedInteger (b )
@@ -632,6 +637,7 @@ func skipLengthEnodedString(b []byte) (int, error) {
632
637
return n , io .EOF
633
638
}
634
639
640
+ // returns the number read, whether the value is NULL and the number of bytes read
635
641
func readLengthEncodedInteger (b []byte ) (uint64 , bool , int ) {
636
642
switch b [0 ] {
637
643
@@ -659,6 +665,7 @@ func readLengthEncodedInteger(b []byte) (uint64, bool, int) {
659
665
return uint64 (b [0 ]), false , 1
660
666
}
661
667
668
+ // encodes a uint64 value and appends it to the given bytes slice
662
669
func appendLengthEncodedInteger (b []byte , n uint64 ) []byte {
663
670
switch {
664
671
case n <= 250 :
0 commit comments