raster

My Raster is a one-dimensional array and colorArray[8][3] is a two dimensional array
How to wrtie the setPixel and getPixel methods?