Skip to main content
corrected spelling, improved formatting, fixed title
Source Link
George Stocker
  • 58k
  • 29
  • 184
  • 239

Can you write out a Byte[] arrayArray be written to a file???? in C# .net 3.5?

I'm trying to write out a Byte[] Byte[] array representing a complete file to a file.

The original file fromthefrom the client is sent via TCP and then recivedreceived by a server. The recivedreceived stream is read to a byte array and then sendsent to be processed by this class.

This is mainly to ensure that the reciving TCPClientreceiving TCPClient is readyforready for the next stream and seperateseparate the recivingreceiving end from the processing end.

The FileStreamFileStream class does not take a byte array as an argument or another Stream object ( which does allow you to write bytes to it).

I'm aiming to get the prcessingprocessing done by a differntdifferent thread from the original ( the one with the TCPClient).

Many thanksI don't know how to implement this, Roberto what should I try?

Can you write out a Byte[] array to file???? C# .net 3.5

I'm trying to write out a Byte[] array representing a complete file to file.

The original file fromthe client is sent via TCP and then recived by a server. The recived stream is read to a byte array and then send to be processed by this class.

This is mainly to ensure that the reciving TCPClient is readyfor the next stream and seperate the reciving end from the processing.

The FileStream class does not take a byte array as an argument or another Stream object ( which does allow you to write bytes to it).

I'm aiming to get the prcessing done by a differnt thread from the original ( the one with the TCPClient).

Many thanks, Roberto

Can a Byte[] Array be written to a file in C#?

I'm trying to write out a Byte[] array representing a complete file to a file.

The original file from the client is sent via TCP and then received by a server. The received stream is read to a byte array and then sent to be processed by this class.

This is mainly to ensure that the receiving TCPClient is ready for the next stream and separate the receiving end from the processing end.

The FileStream class does not take a byte array as an argument or another Stream object ( which does allow you to write bytes to it).

I'm aiming to get the processing done by a different thread from the original ( the one with the TCPClient).

I don't know how to implement this, what should I try?

Source Link
Roberto Bonini
  • 7.3k
  • 6
  • 42
  • 47

Can you write out a Byte[] array to file???? C# .net 3.5

I'm trying to write out a Byte[] array representing a complete file to file.

The original file fromthe client is sent via TCP and then recived by a server. The recived stream is read to a byte array and then send to be processed by this class.

This is mainly to ensure that the reciving TCPClient is readyfor the next stream and seperate the reciving end from the processing.

The FileStream class does not take a byte array as an argument or another Stream object ( which does allow you to write bytes to it).

I'm aiming to get the prcessing done by a differnt thread from the original ( the one with the TCPClient).

Many thanks, Roberto