public static byte [ ] mergeLocalFileDataData ( List < ZipExtraField > data ) { int regularExtraFieldCount = data . size ( ) ; int sum = WORD * regularExtraFieldCount ; for ( ZipExtraField element : data ) { sum += element . getLocalFileDataLength ( ) . getValue ( ) ; } byte [ ] result = new byte [ sum ] ; int start = 0 ; for ( ZipExtraField element : data ) { System . arraycopy ( element . getHeaderId ( ) . getBytes ( ) , 0 , result , start , 2 ) ; System . arraycopy ( element . getLocalFileDataLength ( ) . getBytes ( ) , 0 , result , start + 2 , 2 ) ; byte [ ] local = element . getLocalFileDataData ( ) ; System . arraycopy ( local , 0 , result , start + WORD , local . length ) ; start += ( local . length + WORD ) ; } return result ; }
Merges the local file data fields of the given ZipExtraFields .