256 // |
256 // |
257 void Bytestream::write_short (int16_t val) |
257 void Bytestream::write_short (int16_t val) |
258 { |
258 { |
259 grow_to_fit (2); |
259 grow_to_fit (2); |
260 |
260 |
261 for (int i = 0; i < 2; ++i) |
261 for (int i : range(2)) |
262 write ((val >> (i * 8)) & 0xFF); |
262 write ((val >> (i * 8)) & 0xFF); |
263 } |
263 } |
264 |
264 |
265 // ------------------------------------------------------------------------------------------------- |
265 // ------------------------------------------------------------------------------------------------- |
266 // |
266 // |
267 void Bytestream::write_long (int32_t val) |
267 void Bytestream::write_long (int32_t val) |
268 { |
268 { |
269 grow_to_fit (4); |
269 grow_to_fit (4); |
270 |
270 |
271 for (int i = 0; i < 4; ++i) |
271 for (int i : range(4)) |
272 write ((val >> (i * 8)) & 0xFF); |
272 write ((val >> (i * 8)) & 0xFF); |
273 } |
273 } |
274 |
274 |
275 // ------------------------------------------------------------------------------------------------- |
275 // ------------------------------------------------------------------------------------------------- |
276 // |
276 // |