{Struct, String:StringT, Array:ArrayT, Pointer, uint8, DecodeStream, EncodeStream} = require './index.js' concat = require '../concat-stream/index.js' struct = new Struct name: new StringT uint8 age: uint8 ptr: new Pointer uint8, new StringT uint8 console.log struct.size name: 'devon' age: 21 ptr: 'hello' stream = new EncodeStream stream.pipe concat (buf) -> console.log buf # .should.deep.equal new Buffer [4, 5, 6, 7, 8, 1, 2, 3, 4] array = new ArrayT new Pointer(uint8, uint8), uint8 array.encode(stream, [1, 2, 3, 4]) stream.end()