简体   繁体   中英

ArrayList<byte[]> to byte[][] in Java?

I have a method that returns ArrayList<byte[]> and now I want to know if there is a way I can convert it in byte[][]. I've seen so many questions about ArrayList<byte>, but not ArrayList<byte[]>. Can I do that somehow?

ArrayList<byte[]> list = new ArrayList<>()

to

byte [][] b

list.toArray(new byte[0][])list.stream().toArray(byte[][]::new)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM