# Reverse byteArray?

**URL:** <https://forum.kirupa.com/t/reverse-bytearray/304228>\
**Category:** Uncategorized\
**Created:** [February 3, 2010, 9:21pm UTC](https://forum.kirupa.com/t/reverse-bytearray/304228 "2010-02-03T21:21:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [February 3, 2010, 9:21pm UTC](https://forum.kirupa.com/t/reverse-bytearray/304228/1 "2010-02-03T21:21:54Z")

</div>

I’m storing ByteArray pixel data via BitmapData.getPixels(). The visual representation is rectangle that contains a vertical gradient. Later, I’m using BitmapData.setPixels(); to draw the stored ByteArray to another BitmapData instance. What I’m looking to do, is to reverse the gradient when it’s redrawn via setPixels() so that it’s basically a flip of the same same gradient. In theory, is there away to ‘reverse’ ByteArray to allow me to do that? I’m not yet too familiar with the guts of ByteArray. I know of other ways to handle this by using the draw method along with a Matrix, but with what I’m trying to attempt, the draw method is going to probably be too slow within my iterations compared to setPixels.

Any advice is appreciated, thanks!
