-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa7cf97
commit d3ea965
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/EncryptedOutputStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package ru.olegcherednik.zip4jvm.io.out.entry; | ||
|
||
import ru.olegcherednik.zip4jvm.io.out.data.EncoderDataOutput; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
|
||
/** | ||
* This is an output stream decorator, that is responsible for data encryption. | ||
* | ||
* @author Oleg Cherednik | ||
* @since 29.10.2024 | ||
*/ | ||
@RequiredArgsConstructor | ||
public class EncryptedOutputStream extends OutputStream { | ||
|
||
private final EncoderDataOutput encoderDataOutput; | ||
private final OutputStream delegate; | ||
|
||
@Override | ||
public final void write(int b) throws IOException { | ||
delegate.write(b); | ||
} | ||
|
||
@Override | ||
public void write(byte[] buf, int offs, int len) throws IOException { | ||
delegate.write(buf, offs, len); | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
delegate.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters