func (e *RowsEvent) decodeJsonBinary(data []byte) ([]byte, error) {
	if len(data) == 0 {
		return []byte{}, nil
	}
	d := jsonBinaryDecoder{useDecimal: e.useDecimal}
	if d.isDataShort(data, 1) {
		return nil, d.err
	}
	v := d.decodeValue(data[0], data[1:])
	if d.err != nil {
		return nil, d.err
	}
	return json.Marshal(v)
}
decodeJsonBinary decodes the JSON binary encoding data and returns
the common JSON encoding data.
package replication
import (
	"encoding/json"
	"fmt"
	"math"
	"github.com/juju/errors"
	. "github.com/siddontang/go-mysql/mysql"
	"github.com/siddontang/go/hack"
)
const (
	JSONB_SMALL_OBJECT byte = iota  
	JSONB_LARGE_OBJECT              
	JSONB_SMALL_ARRAY               
	JSONB_LARGE_ARRAY               
	JSONB_LITERAL                   
	JSONB_INT16                     
	JSONB_UINT16                    
	JSONB_INT32                     
	JSONB_UINT32                    
	JSONB_INT64                     
	JSONB_UINT64                    
	JSONB_DOUBLE                    
	JSONB_STRING                    
	JSONB_OPAQUE       byte = 0x0f  
)
const (
	JSONB_NULL_LITERAL  byte = 0x00
	JSONB_TRUE_LITERAL  byte = 0x01
	JSONB_FALSE_LITERAL byte = 0x02
)
const (
	jsonbSmallOffsetSize = 2
	jsonbLargeOffsetSize = 4
	jsonbKeyEntrySizeSmall = 2 + jsonbSmallOffsetSize
	jsonbKeyEntrySizeLarge = 2 + jsonbLargeOffsetSize
	jsonbValueEntrySizeSmall = 1 + jsonbSmallOffsetSize
	jsonbValueEntrySizeLarge = 1 + jsonbLargeOffsetSize
)
func jsonbGetOffsetSize(isSmall bool) int {
	if isSmall {
		return jsonbSmallOffsetSize
	}
	return jsonbLargeOffsetSize
}
func jsonbGetKeyEntrySize(isSmall bool) int {
	if isSmall {
		return jsonbKeyEntrySizeSmall
	}
	return jsonbKeyEntrySizeLarge
}
func jsonbGetValueEntrySize(isSmall bool) int {
	if isSmall {
		return jsonbValueEntrySizeSmall
	}
	return jsonbValueEntrySizeLarge
}