1

I am working on a camera app, I take my picture and the data is gathered as a byte[]...I don't want to store the images on the phones memory, what I want to be able to do is store the byte array for each capture up to a max of 5. So I'm wondering is it possible to create an array of byte arrays? Then I can add, remove arrays at the specified index location. Perhaps an array list? or do I have to use a db?

I've researched but came up with nothing, any thoughts would be appreciated.

*EDIT*

So just to ensure what I'm doing is correct here is my code..

public void addImage(byte[] IMdata) {
        // TODO Auto-generated method stub

        //Traverses Through ImageByteArray
        for (int i = 0; i < ImageByteArray.length; i++) {
            //Checks index position is empty
            if (ImageByteArray[i] == null) {
                //If so store IMdata in the Array
                ImageByteArray[i] = IMdata;
            }
        }
    }
4

1 回答 1

3

所以我想知道是否可以创建一个字节数组?

是的,它称为二维数组(向下滚动到访问多维数组的元素

byte[][] twoDByteArray=new byte[5][1024];

相关帖子

于 2013-07-18T14:25:00.310 回答