Why does bytebuffer.clear affect the data I have in list? Why is there such a difference between byte [] and byte?

I read the data from socket as follows

List<byte[]> list = new ArrayList<>();
while(boo) {
                ilen = bc.read(byteBuffer);
                if (ilen <= 0) {
                    boo = false;
                } else {
                    num += ilen;
                    byte[] bytes = byteBuffer.array();
                    list.add(byteBuffer.array());
                }
                byteBuffer.clear();
            }

at this time, there is still the normal data I obtained in list, but when all the data is obtained, I query the data in list, and the data in it is all empty. Why? And if I change the generics of list to byte, everything will be fine!

Mar.20,2021
Menu