public override unsafe void Write(byte[] buffer, int offset, int count) { byte[] buffer2; if (!this.CanWrite) { throw new NotImplementedException("Stream open for reading only"); } if (offset == 0) { buffer2 = buffer; } else { buffer2 = new byte[count]; Buffer.BlockCopy(buffer, offset, buffer2, 0, count); } int num = MobileDevice.AFCFileRefWrite(this.phone.AFCHandle, this.handle, buffer2, (uint)count); }
/// <summary> /// Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. /// </summary> /// <param name="buffer">An array of bytes. This method copies count bytes from buffer to the current stream.</param> /// <param name="offset">The zero-based byte offset in buffer at which to begin copying bytes to the current stream.</param> /// <param name="count">The number of bytes to be written to the current stream.</param> unsafe public override void Write(byte[] buffer, int offset, int count) { if (!CanWrite) { throw new NotImplementedException("Stream open for reading only"); } byte[] temp; if (offset == 0) { temp = buffer; } else { temp = new byte[count]; Buffer.BlockCopy(buffer, offset, temp, 0, count); } int ret = MobileDevice.AFCFileRefWrite(phone.AFCHandle, handle, temp, (uint)count); }