Add decode and encode to and from bytes