 varuint = new VarInt ['u8', 'u16', 'u32']
 
 class Utf8String extends Type
+	create: -> ''
 	bitLength: (v) ->
 		l = stringToUtf8(v).length
 		varuint.bitLength(l) + 8*l

		for name, i in @members
			@index[name] = i
		@bits = bitsNeeded @members.length - 1
	bitLength: -> @bits
	unpackFrom: (r) -> @members[r.readBits @bits]
	packInto: (w, v) ->


class Primitive extends Type
	constructor: (@t, @bits, @min, @max) -> super(); @t += @bits
	create: -> 0
	bitLength: -> @bits
	unpackFrom: (r) -> r[@t]()
	packInto: (w, v) -> w[@t] v
