| 88 | } |
| 89 | |
| 90 | void amrex::readLongData (Long* data, std::size_t size, std::istream& is, |
| 91 | const IntDescriptor& id) |
| 92 | { |
| 93 | if (id == FPC::NativeLongDescriptor()) |
| 94 | { |
| 95 | if (!is.read(reinterpret_cast<char*>(data), |
| 96 | static_cast<std::streamsize>(size * id.numBytes()))) |
| 97 | { |
| 98 | amrex::Error("Failed to read long integer data."); |
| 99 | } |
| 100 | } |
| 101 | else if (id.numBytes() == 2) |
| 102 | { |
| 103 | readIntData<Long, std::int16_t>(data, size, is, id); |
| 104 | } |
| 105 | else if (id.numBytes() == 4) |
| 106 | { |
| 107 | readIntData<Long, std::int32_t>(data, size, is, id); |
| 108 | } |
| 109 | else if (id.numBytes() == 8) |
| 110 | { |
| 111 | readIntData<Long, std::int64_t>(data, size, is, id); |
| 112 | } |
| 113 | else { |
| 114 | amrex::Error("Don't know how to work with this long type."); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | void amrex::writeRealData (const Real* data, std::size_t size, std::ostream& os, |
| 119 | const RealDescriptor& rd) |