pub fn write(&mut self, buffer: &[u8]) -> P {

        let buffer_len = buffer.len() as u32;
        let write_len  = buffer_len + 4; // including size-prefix

        let target_ptr = self.alloc_write_space(write_len as u64);

        let flatfile   = self.get_flatfile(target_ptr.get_file_number());

        // write size & buffer
        flatfile.put(&buffer_len,  target_ptr.get_file_offset() as usize);
        flatfile.put_slice(buffer, (target_ptr.get_file_offset() + 4) as usize);

        target_ptr
    }
/// Appends the slice to the flatfileset and returns a filepos
///
/// Internally, this will ensure creation of new files
Appends the slice to the flatfileset and returns a filepos
Internally, this will ensure creation of new files
Appends the slice to the flatfileset and returns a filepos Internally this will ensure creation of new files
pub fn write(&mut self, buffer: &[u8]) -> P {
        let buffer_len = buffer.len() as u32;
        let write_len  = buffer_len + 4; // including size-prefix
        let target_ptr = self.alloc_write_space(write_len as u64);
        let flatfile   = self.get_flatfile(target_ptr.get_file_number());
        // write size & buffer
        flatfile.put(&buffer_len,  target_ptr.get_file_offset() as usize);
        flatfile.put_slice(buffer, (target_ptr.get_file_offset() + 4) as usize);
        target_ptr
    }
pub fn write ( & mut self , buffer : & [ u8 ] ) -> P { let buffer_len = buffer . len ( ) as u32 ; let write_len = buffer_len + 4 ; // including size-prefix let target_ptr = self . alloc_write_space ( write_len as u64 ) ; let flatfile = self . get_flatfile ( target_ptr . get_file_number ( ) ) ; // write size & buffer flatfile . put ( & buffer_len , target_ptr . get_file_offset ( ) as usize ) ; flatfile . put_slice ( buffer , ( target_ptr . get_file_offset ( ) + 4 ) as usize ) ; target_ptr }
Appends the slice to the flatfileset and returns a filepos
Internally, this will ensure creation of new files
Appends the slice to the flatfileset and returns a filepos Internally this will ensure creation of new files
&mut self
buffer
&[u8]
&mut self
buffer
&[u8]