Implement bounded Binary LLSD codec

This commit is contained in:
2026-08-09 00:29:07 +00:00
parent d152e80ef9
commit 7a4f1f2fb1
17 changed files with 965 additions and 208 deletions

View File

@@ -17,7 +17,7 @@ use libremetaverse_compat_tests::{assert_bytes_eq, assert_close};
use libremetaverse_structured_data::{OSD, OSDParser, OSDType};
use libremetaverse_types::compat::{StringReader, Uri, Utf16CodeUnit};
use libremetaverse_types::{UUID, Utils};
use std::io::{Cursor, Read, Write};
use std::io::{Cursor, Read, Seek, SeekFrom, Write};
use std::sync::{Arc, Mutex};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
@@ -173,6 +173,12 @@ impl Write for SharedCursor {
}
}
impl Seek for SharedCursor {
fn seek(&mut self, position: SeekFrom) -> std::io::Result<u64> {
self.0.lock().expect("cursor lock").seek(position)
}
}
const BINARY_STRING_CONTENT: &[u8] = b"testing a simple binary conversion for this string\n\r";
const BINARY_NESTED_VALUE: &[u8] = &[
0x5b, 0, 0, 0, 3, 0x7b, 0, 0, 0, 2, 0x6b, 0, 0, 0, 4, b't', b'e', b's', b't', 0x73, 0, 0, 0, 4,