Changeset 1430 for trunk/docx4j/src/main/java/org/docx4j/openpackaging
- Timestamp:
- 02/21/11 09:51:41 (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/openpackaging/io/SaveToZipFile.java
r1379 r1430 386 386 String resolvedPartUri = part.getPartName().getName().substring(1); 387 387 388 //InputStream bin = ((BinaryPart)part).getBinaryData();389 390 388 try { 391 389 // Add ZIP entry to output stream. 392 390 out.putNextEntry(new ZipEntry(resolvedPartUri)); 393 394 // Copy the input stream to the output stream 395 // byte[] buffer = new byte[8192]; 396 // int amount; 397 // while (( amount = bin.read(buffer)) >=0 ) { 398 // log.debug(amount); 399 // out.write(buffer, 0, amount); 400 // } 391 392 java.nio.ByteBuffer bb = ((BinaryPart)part).getBuffer(); 393 byte[] bytes = null; 394 bytes = new byte[bb.limit()]; 395 bb.get(bytes); 401 396 402 java.nio.ByteBuffer bb = ((BinaryPart)part).getBuffer();403 bb.clear();404 byte[] bytes = new byte[bb.capacity()];405 bb.get(bytes, 0, bytes.length);406 407 397 out.write( bytes ); 408 398
Note: See TracChangeset
for help on using the changeset viewer.
