added hdrlen; define little-endian flag.