@@ -600,6 +600,9 @@ func stringToInt(b []byte) int {
600600 return val
601601}
602602
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
603606func readLengthEnodedString (b []byte ) ([]byte , bool , int , error ) {
604607 // Get length
605608 num , isNull , n := readLengthEncodedInteger (b )
@@ -616,6 +619,8 @@ func readLengthEnodedString(b []byte) ([]byte, bool, int, error) {
616619 return nil , false , n , io .EOF
617620}
618621
622+ // returns the number of bytes skipped and an error, in case the string is
623+ // longer than the input slice
619624func skipLengthEnodedString (b []byte ) (int , error ) {
620625 // Get length
621626 num , _ , n := readLengthEncodedInteger (b )
@@ -632,6 +637,7 @@ func skipLengthEnodedString(b []byte) (int, error) {
632637 return n , io .EOF
633638}
634639
640+ // returns the number read, whether the value is NULL and the number of bytes read
635641func readLengthEncodedInteger (b []byte ) (uint64 , bool , int ) {
636642 switch b [0 ] {
637643
@@ -659,6 +665,7 @@ func readLengthEncodedInteger(b []byte) (uint64, bool, int) {
659665 return uint64 (b [0 ]), false , 1
660666}
661667
668+ // encodes a uint64 value and appends it to the given bytes slice
662669func appendLengthEncodedInteger (b []byte , n uint64 ) []byte {
663670 switch {
664671 case n <= 250 :
0 commit comments