Is it possible to convert through a for loop?
for
Is there a better way to do this?
for (int i = 0; i < myListByte.Count ;i++) { myArryByte[i] = myListByte[i]; }
myArrayByte = myListByte.ToArray();
List<byte> bytes = ...; byte[] bArrary = bytes.ToArray();
Use the List object toArray method .
byte[] arr = myListByte.ToArray();
This may be what you are looking for:
private void convertByteArray() { List<byte> byteList = new List<byte>() {2, 3, 4}; byte[] byteArray = byteList.ToArray<byte>(); }
byte[] converted = myListByte.ToArray();
Source: https://habr.com/ru/post/888975/More articles:How to get a subset of a DataFrame that has only elements that appear in a set more than once in R - rHow to deal with Treetop left recursion - ruby โโ| fooobar.comRemoving left recursion - compiler-constructionTriangular Grammar Treetop - ruby โโ| fooobar.comGetting the full C # tag URL - phpGWT Celltable only displays 15 rows - javaAnt: copy the same set of files to several places - continued - copyHow to show full message when clicking on message tag in asp.net? - asp.netDoes zlib provide the ability to decompress from the middle of the file - cString.xml provides me with an invalid string for ProcessDialog - androidAll Articles