Remove First 16 Bytes?

前端 未结 4 686
离开以前
离开以前 2021-01-18 00:34

How would I go about removing a number of bytes from a byte array?

4条回答
  •  遇见更好的自我
    2021-01-18 01:13

    I will also mention - depending on how you plan to use the results, often, an alternative approach is to use ArraySegment to just access the remaining portion of the array. This prevents the need to copy the array, which can be more efficient in some usage scenarios:

    ArraySegment segment = new ArraySegment(originalArray, 16, originalArray.Length-16);
    
    // Use segment how you'd use your array...  
    

提交回复
热议问题