/// <summary> /// Send a whole file, given a prebuffer and a postbuffer, and if the 8 bytes length is sent before the real message. /// </summary> /// <param name="filepath">The path to the file</param> /// <param name="preBuffer">A prefixed buffer</param> /// <param name="postBuffer">A suffixed buffer</param> /// <param name="withLengthPrefixed">if the 4 bytes length is sent before the real message</param> /// <param name="preBufferIsBeforeLength">Weither the prebuffer is placed before the length prefix (if applicable)</param> /// <returns>A Task</returns> /// <remarks>If withLengthPrefixed is true, it's important for the receiving end to know that he is receiving a longer a 8 bytes length prefix. For the receiving end and within this class, you can set 'InfoHandler.ReadNextAsLong' to true to do so.</remarks> public async Task SendFileAsync(string filepath, byte[] preBuffer = null, byte[] postBuffer = null, bool withLengthPrefixed = true, bool preBufferIsBeforeLength = false) { await InfoHandler.SendFileAsync(filepath, preBuffer, postBuffer, withLengthPrefixed, preBufferIsBeforeLength); }