func readLen4(r io.Reader) (uint32, error) {
    var val uint32
    var shift uint
    for i := 0; i < 4; i++ {
        var buf [1]byte
        if _, err := io.ReadFull(r, buf[:]); err != nil {
            return val, err
        } else {
            b := buf[0]
            val |= (uint32(b & 0x7f) << shift)
            if (b & 0x80) == 0 {
                return val, nil
            }
        }
        shift += 7
    }
    return val, errors.New("readLen4: Bad format reading len4")
}
// Read from io.Reader and decode as len4

Read from io.Reader and decode as len4
// Read from io . Reader and decode as len4
func readLen4(r io.Reader) (uint32, error) {
    var val uint32
    var shift uint
    for i := 0; i < 4; i++ {
        var buf [1]byte
        if _, err := io.ReadFull(r, buf[:]); err != nil {
            return val, err
        } else {
            b := buf[0]
            val |= (uint32(b & 0x7f) << shift)
            if (b & 0x80) == 0 {
                return val, nil
            }
        }
        shift += 7
    }
    return val, errors.New("readLen4: Bad format reading len4")
}
func readLen4 ( r io . Reader ) ( uint32 , error ) { var val uint32 var shift uint for i := 0 ; i < 4 ; i ++ { var buf [ 1 ] byte if _ , err := io . ReadFull ( r , buf [ : ] ) ; err != nil { return val , err } else { b := buf [ 0 ] val |= ( uint32 ( b & 0x7f ) << shift ) if ( b & 0x80 ) == 0 { return val , nil } } shift += 7 } return val , errors . New ( " " ) }
Read from io.Reader and decode as len4
Read from io . Reader and decode as len4