I don't know, this doesn't look all that efficient to me. Why not:

```c
if (!non_native_endian) {
  return Number::New(*reinterpret_cast<T*>(ptr));
} else {
  char buf[sizeof(T)];
  size_t i;
  for (i = 0; i < sizeof(T); i++)
    buf[i] = ptr[sizeof(T) - 1 - i];
  return Number::New(*reinterpret_cast<T*>(buf));
}
```