summaryrefslogtreecommitdiff
path: root/codec/helper.go
diff options
context:
space:
mode:
authorUgorji Nwoke <ugorji@gmail.com>2013-11-14 20:34:29 -0500
committerUgorji Nwoke <ugorji@gmail.com>2013-11-14 20:34:29 -0500
commit10b6078349f65c32aa4781b43655492dcb305065 (patch)
treeb77f5803b8b017149bb6e0bf0c3ba92cfa2372bf /codec/helper.go
parentf9639b93c506f8191c4a7fd7634fd3c7282e972a (diff)
codec: Add support for decoding byte slices, even if encoded as a regular array.
This requires us checking currentEncodedType in the stream first, before deciding how to decode the value when decoding into a slice. There's a slight performance hit, but correctness is more important. Also, put in flag to "conditionally" enable encoding uint as positive fixint, and update tests so they work across binc and msgpack and regardless of flag. (This means ensuring that all unsigned int values in test are > 128). (I probably will not enable this flag by default, but it's there ... for placeholding and reminder). Fixes issue #26 . Updates issue #24 .
Diffstat (limited to 'codec/helper.go')
-rw-r--r--codec/helper.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/codec/helper.go b/codec/helper.go
index 7ba88c2..a26c434 100644
--- a/codec/helper.go
+++ b/codec/helper.go
@@ -74,6 +74,8 @@ const (
valueTypeArray
valueTypeTimestamp
valueTypeExt
+
+ valueTypeInvalid = 0xff
)
var (