5 #include "packager/media/base/network_util.h"
7 namespace edash_packager {
10 uint32_t ntohlFromBuffer(
const unsigned char* buf) {
11 return (static_cast<uint32_t>(buf[0]) << 24) |
12 (
static_cast<uint32_t
>(buf[1]) << 16) |
13 (
static_cast<uint32_t
>(buf[2]) << 8) | (
static_cast<uint32_t
>(buf[3]));
16 uint16_t ntohsFromBuffer(
const unsigned char* buf) {
17 return (static_cast<uint16_t>(buf[0]) << 8) | (
static_cast<uint16_t
>(buf[1]));
20 uint64_t ntohllFromBuffer(
const unsigned char* buf) {
21 return (static_cast<uint64_t>(buf[0]) << 56) |
22 (
static_cast<uint64_t
>(buf[1]) << 48) |
23 (
static_cast<uint64_t
>(buf[2]) << 40) |
24 (
static_cast<uint64_t
>(buf[3]) << 32) |
25 (
static_cast<uint64_t
>(buf[4]) << 24) |
26 (
static_cast<uint64_t
>(buf[5]) << 16) |
27 (
static_cast<uint64_t
>(buf[6]) << 8) | (
static_cast<uint64_t
>(buf[7]));