func UnmarshalAsJSON(w io.Writer, msg []byte) ([]byte, error) {
	var (
		scratch []byte
		cast    bool
		dst     jsWriter
		err     error
	)
	if jsw, ok := w.(jsWriter); ok {
		dst = jsw
		cast = true
	} else {
		dst = bufio.NewWriterSize(w, 512)
	}
	for len(msg) > 0 && err == nil {
		msg, scratch, err = writeNext(dst, msg, scratch)
	}
	if !cast && err == nil {
		err = dst.(*bufio.Writer).Flush()
	}
	return msg, err
}
UnmarshalAsJSON takes raw messagepack and writes
it as JSON to 'w'. If an error is returned, the
bytes not translated will also be returned. If
no errors are encountered, the length of the returned
slice will be zero.
package msgp
import (
	"bufio"
	"encoding/base64"
	"encoding/json"
	"io"
	"strconv"
	"time"
)
var unfuns [_maxtype]func(jsWriter, []byte, []byte) ([]byte, []byte, error)
func init() {
	unfuns = [_maxtype]func(jsWriter, []byte, []byte) ([]byte, []byte, error){
		StrType:        rwStringBytes,
		BinType:        rwBytesBytes,
		MapType:        rwMapBytes,
		ArrayType:      rwArrayBytes,
		Float64Type:    rwFloat64Bytes,
		Float32Type:    rwFloat32Bytes,
		BoolType:       rwBoolBytes,
		IntType:        rwIntBytes,
		UintType:       rwUintBytes,
		NilType:        rwNullBytes,
		ExtensionType:  rwExtensionBytes,
		Complex64Type:  rwExtensionBytes,
		Complex128Type: rwExtensionBytes,
		TimeType:       rwTimeBytes,
	}
}