0

I want to process received data with renderscript, it contains 2 bytes header and few hundreds unaligned 3 bytes samples, which are represented in rs as vectors of 3 unsigned chars, so I need to copy samples only and strip the header.

Can I do it without copying part of array to the new array and filling Allocation from it?

Tried to use Allocation.copy1DRangeFrom, but now I'm assuming that offset parameter is an offset in the Allocation itself, not in the source array.

Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79
Pavlus
  • 1,651
  • 1
  • 13
  • 24

1 Answers1

0

Used NIO channel scattering read to separately read header and payload to different buffers and fill Allocation from buffer-backing array.

Pavlus
  • 1,651
  • 1
  • 13
  • 24