Ejemplo n.º 1
0
 /// <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>
 /// <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 void SendFile(string filepath, byte[] preBuffer = null, byte[] postBuffer = null, bool withLengthPrefixed = true, bool preBufferIsBeforeLength = false)
 {
     InfoHandler.SendFile(filepath, preBuffer, postBuffer, withLengthPrefixed, preBufferIsBeforeLength);
 }