3
Contributors
5
Replies
7
Views
4 Years
Discussion Span
Last Post by zeusprog
0

Integer values won't fit in a byte. Perhaps you could show a small example of what Integer values you expect, and how they should look after being converted?

0

Hi, guys this is what I tried.

        Object kTemp[] = kList.toArray();
        byte[] kByte = new byte[CHUNK];

        for(int i=0; i<CHUNK; i++){
            kByte[i] = kTemp.getBytes();
            System.out.println(kByte[i]);
        }

But I got an error

attack.java:180: cannot find symbol
symbol  : method getBytes()
location: class java.lang.Object[]
            kByte[i] = kTemp.getBytes();
                            ^
1 error

I also tried

        byte[] kByte = kList.getBytes();
        System.out.println(kByte);

and got the error

attack.java:177: cannot find symbol
symbol  : variable kList
location: class Attack
        byte[] kByte = kList.getBytes();
                       ^
1 error

Please can anyone suggest a way to get this done. Thank you

0

The compiler can not find definitions for some of the variables and methods you are using.
Where is the getBytes() method defined for an array?
Where is the variable: kList defined?

Where is the ArrayList<Integer>?

Edited by NormR1

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.