Пример #1
0
 internal unsafe static void ManagedStreamLength(Stream stream, IntPtr returnValueAddress)
 {
     if (returnValueAddress == IntPtr.Zero)
     {
         throw new ArgumentException("Return value address cannot be 0.", "returnValueAddress");
     }
     ManagedStreamHelpers.ValidateLoadFromStream(stream);
     *(long *)((void *)returnValueAddress) = stream.Length;
 }
Пример #2
0
 internal unsafe static void ManagedStreamRead(byte[] buffer, int offset, int count, Stream stream, IntPtr returnValueAddress)
 {
     if (returnValueAddress == IntPtr.Zero)
     {
         throw new ArgumentException("Return value address cannot be 0.", "returnValueAddress");
     }
     ManagedStreamHelpers.ValidateLoadFromStream(stream);
     *(int *)((void *)returnValueAddress) = stream.Read(buffer, offset, count);
 }
Пример #3
0
 internal unsafe static void ManagedStreamSeek(long offset, uint origin, Stream stream, IntPtr returnValueAddress)
 {
     if (returnValueAddress == IntPtr.Zero)
     {
         throw new ArgumentException("Return value address cannot be 0.", "returnValueAddress");
     }
     ManagedStreamHelpers.ValidateLoadFromStream(stream);
     *(long *)((void *)returnValueAddress) = stream.Seek(offset, (SeekOrigin)origin);
 }
Пример #4
0
 public static AssetBundle LoadFromStream(Stream stream, [DefaultValue("0")] uint crc, [DefaultValue("0")] uint managedReadBufferSize)
 {
     ManagedStreamHelpers.ValidateLoadFromStream(stream);
     return(AssetBundle.LoadFromStreamInternal(stream, crc, managedReadBufferSize));
 }