Skip to content

Commit

Permalink
#103 Avoid array when ECD
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-cherednik committed Nov 23, 2024
1 parent 17de3e0 commit ffff4bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import ru.olegcherednik.zip4jvm.exception.CompressionNotSupportedException;
import ru.olegcherednik.zip4jvm.io.in.data.BaseDataInput;
import ru.olegcherednik.zip4jvm.io.in.data.DataInput;
import ru.olegcherednik.zip4jvm.io.in.data.ecd.StoreDataInput;
import ru.olegcherednik.zip4jvm.model.CompressionMethod;
import ru.olegcherednik.zip4jvm.model.entry.ZipEntry;

Expand All @@ -37,14 +38,14 @@
*/
public abstract class CompressedEntryDataInput extends BaseDataInput {

public static CompressedEntryDataInput create(ZipEntry zipEntry,
Function<Charset, Charset> charsetCustomizer,
DataInput in) {
public static DataInput create(ZipEntry zipEntry,
Function<Charset, Charset> chrsetCustomizer,
DataInput in) {
CompressionMethod compressionMethod = zipEntry.getCompressionMethod();
// TODO we should check max available bytes

if (compressionMethod == CompressionMethod.STORE)
return new StoreEntryDataInput(in);
return new StoreDataInput(in);
if (compressionMethod == CompressionMethod.DEFLATE)
return new InflateEntryDataInput(in);
if (compressionMethod == CompressionMethod.ENHANCED_DEFLATE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
* @author Oleg Cherednik
* @since 21.11.2024
*/
final class StoreDataInput extends CompressedDataInput {
public final class StoreDataInput extends CompressedDataInput {

StoreDataInput(DataInput in) {
public StoreDataInput(DataInput in) {
super(in);
}

Expand Down

0 comments on commit ffff4bc

Please sign in to comment.