public static byte [ ] concat ( Bytes ... listOfBytes ) { int offset = 0 ; int size = 0 ; for ( Bytes b : listOfBytes ) { size += b . length ( ) + checkVlen ( b . length ( ) ) ; } byte [ ] data = new byte [ size ] ; for ( Bytes b : listOfBytes ) { offset = writeVint ( data , offset , b . length ( ) ) ; b . copyTo ( 0 , b . length ( ) , data , offset ) ; offset += b . length ( ) ; } return data ; }
Concatenates of list of Bytes objects to create a byte array