added type checks for Big and Little endianstreams