8 #ifndef AJA_BYTESTREAM_H
9 #define AJA_BYTESTREAM_H
23 void Seek(
size_t val);
27 void Set(uint8_t val,
size_t bytes);
28 void Write(
const void *buf,
size_t bytes);
37 void Read(
void *buf,
size_t LEn);
56 return (
size_t)(c - b);
84 uint8_t *last = c + bytes;
85 while(c != last) *c++ = val;
90 memcpy(c, buf, bytes);
102 c[1] = (val >> 8) & 0xFF;
108 c[0] = (val >> 8) & 0xFF;
116 c[1] = (val >> 8) & 0xFF;
117 c[2] = (val >> 16) & 0xFF;
118 c[3] = (val >> 24) & 0xFF;
124 c[0] = (val >> 24) & 0xFF;
125 c[1] = (val >> 16) & 0xFF;
126 c[2] = (val >> 8) & 0xFF;
134 c[1] = (val >> 8) & 0xFF;
135 c[2] = (val >> 16) & 0xFF;
136 c[3] = (val >> 24) & 0xFF;
137 c[4] = (val >> 32) & 0xFF;
138 c[5] = (val >> 40) & 0xFF;
139 c[6] = (val >> 48) & 0xFF;
140 c[7] = (val >> 56) & 0xFF;
146 c[0] = (val >> 56) & 0xFF;
147 c[1] = (val >> 48) & 0xFF;
148 c[2] = (val >> 40) & 0xFF;
149 c[3] = (val >> 32) & 0xFF;
150 c[4] = (val >> 24) & 0xFF;
151 c[5] = (val >> 16) & 0xFF;
152 c[6] = (val >> 8) & 0xFF;
159 uint8_t *last = c + bytes, *o = (uint8_t *)buf;
160 while(c != last) *o++ = *c++;
170 ret = (uint16_t)c[0];
171 ret |= (uint16_t)c[1] << 8;
178 ret = (uint16_t)c[0] << 8;
179 ret |= (uint16_t)c[1];
186 ret = (uint32_t)c[0];
187 ret |= (uint32_t)c[1] << 8;
188 ret |= (uint32_t)c[2] << 16;
189 ret |= (uint32_t)c[3] << 24;
196 ret = (uint32_t)c[0] << 24;
197 ret |= (uint32_t)c[1] << 16;
198 ret |= (uint32_t)c[2] << 8;
199 ret |= (uint32_t)c[3];
206 ret = (uint64_t)c[0];
207 ret |= (uint64_t)c[1] << 8;
208 ret |= (uint64_t)c[2] << 16;
209 ret |= (uint64_t)c[3] << 24;
210 ret |= (uint64_t)c[4] << 32;
211 ret |= (uint64_t)c[5] << 40;
212 ret |= (uint64_t)c[6] << 48;
213 ret |= (uint64_t)c[7] << 56;
220 ret = (uint64_t)c[0] << 56;
221 ret |= (uint64_t)c[1] << 48;
222 ret |= (uint64_t)c[2] << 40;
223 ret |= (uint64_t)c[3] << 32;
224 ret |= (uint64_t)c[4] << 24;
225 ret |= (uint64_t)c[5] << 16;
226 ret |= (uint64_t)c[6] << 8;
227 ret |= (uint64_t)c[7];