added support for big and little endian encoders