File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
poi-ooxml/src/main/java/org/apache/poi/xssf/streaming Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class OpcOutputStream extends DeflaterOutputStream {
3737 private final List <Entry > entries = new ArrayList <>();
3838 private final CRC32 crc = new CRC32 ();
3939 private Entry current ;
40- private int written = 0 ;
40+ private long written = 0 ;
4141 private boolean finished = false ;
4242
4343 /**
@@ -84,7 +84,7 @@ public void closeEntry() throws IOException {
8484 }
8585
8686 current .size = def .getBytesRead ();
87- current .compressedSize = Math . toIntExact ( def .getBytesWritten () );
87+ current .compressedSize = def .getBytesWritten ();
8888 current .crc = crc .getValue ();
8989
9090 written += current .compressedSize ;
@@ -106,7 +106,7 @@ public void finish() throws IOException {
106106 if (current != null ) {
107107 closeEntry ();
108108 }
109- int offset = written ;
109+ long offset = written ;
110110 for (Entry entry : entries ) {
111111 written += spec .writeCEN (entry );
112112 }
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ static class Entry {
4646 final String filename ;
4747 long crc ;
4848 long size ;
49- int compressedSize ;
50- int offset ;
49+ long compressedSize ;
50+ long offset ;
5151
5252 Entry (String filename ) {
5353 this .filename = filename ;
@@ -128,7 +128,7 @@ int writeCEN(Entry entry) throws IOException {
128128 /**
129129 * Write End of central directory record (EOCD)
130130 */
131- int writeEND (int entriesCount , int offset , int length ) throws IOException {
131+ int writeEND (int entriesCount , long offset , long length ) throws IOException {
132132 written = 0 ;
133133 writeInt (PK0506 ); // "PK\005\006"
134134 writeShort (0 ); // number of this disk
You can’t perform that action at this time.
0 commit comments