MCPcopy Create free account
hub / github.com/apache/fory / write_u16

Method write_u16

rust/fory-core/src/buffer.rs:176–186  ·  view source on GitHub ↗
(&mut self, value: u16)

Source from the content-addressed store, hash-verified

174
175 #[inline(always)]
176 pub fn write_u16(&mut self, value: u16) {
177 #[cfg(target_endian = "little")]
178 {
179 let bytes = unsafe { &*(&value as *const u16 as *const [u8; 2]) };
180 self.bf.extend_from_slice(bytes);
181 }
182 #[cfg(target_endian = "big")]
183 {
184 self.bf.extend_from_slice(&value.to_le_bytes());
185 }
186 }
187
188 // ============ UINT32 (TypeId = 11) ============
189

Callers 8

write_i16Method · 0.80
_write_var_u32Method · 0.80
_write_var_u64Method · 0.80
write_f16Method · 0.80
write_bf16Method · 0.80
write_usizeMethod · 0.80
write_var_u36_smallMethod · 0.80
write_typed_payloadFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected