Ejemplo n.º 1
0
 public byte[] Read(string path)
 {
     byte[] read;
     using (XenStoreMemoryHandle mem = XenStoreFunctions.xs2_read(this.xenStoreHandle, path))
     {
         read = mem.Value;
     }
     return read;
 }
Ejemplo n.º 2
0
        // Write_bin has been depricated
//        public static bool xs2_write_bin(XenStoreHandle handle, string path, byte[] data, int size)
//        {
//            return xs2_write_bin_impl(handle, path, data, size);
//        }

//        public static bool xs2_write_bin(XenStoreHandle handle, string path, byte[] data)
//        {
//            return xs2_write_bin_impl(handle, path, data, data.Length);
//        }

        public static XenStoreMemoryHandle xs2_read(XenStoreHandle handle,
            string path)
        {
            int len;
            XenStoreMemoryHandle mem = xs2_read_impl(handle, path, out len);
            if (mem != null)
            {
                // Output includes nul-terminator, but len doesn't.
                mem.Count = len + 1;
            }

            return mem;
        }