Add Decoder/Encoder interfaces and ReadPacket/WritePacket