Splitting a byte[] into multiple byte[] arrays in C#

前端 未结 4 1981
天涯浪人
天涯浪人 2020-12-09 21:51

I am trying to \"chunk\" up the bytes of an image. This will allow me to upload a large image in portions. I have the image currently stored as one large byte[]. I would lik

4条回答
  •  不知归路
    2020-12-09 22:30

    public static IEnumerable Split(this byte[] value,int bufferLength){
       int countOfArray = value.Length / bufferLength;
       if(value.Length % bufferLength > 0)
          countOfArray ++;
       for(int i=0;i

    This is my extension what I used

提交回复
热议问题