MCPcopy Create free account
hub / github.com/apache/arrow-rs / encode_avro_long

Function encode_avro_long

arrow-avro/src/reader/record.rs:2749–2758  ·  view source on GitHub ↗
(value: i64)

Source from the content-addressed store, hash-verified

2747 }
2748
2749 fn encode_avro_long(value: i64) -> Vec<u8> {
2750 let mut buf = Vec::new();
2751 let mut v = (value << 1) ^ (value >> 63);
2752 while v & !0x7F != 0 {
2753 buf.push(((v & 0x7F) | 0x80) as u8);
2754 v >>= 7;
2755 }
2756 buf.push(v as u8);
2757 buf
2758 }
2759
2760 fn encode_avro_bytes(bytes: &[u8]) -> Vec<u8> {
2761 let mut buf = encode_avro_long(bytes.len() as i64);

Calls 1

pushMethod · 0.45