mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Simplify the Ghostryde API
First step of RDE encoding refactoring. Creates a single InputStream (OutputStream) to decode (encode) Ghostryde files. This replaces the 3 InputStreams (OutputStreams) that were needed before. Also removes a lot of classes, and removes the "injection" of the Ghostryde class. It's an encoding, there's no point in injecting it. Finally, removed the buffer-size configuration and replaced with a static final const value. It's just a buffer size - it doesn't actually affect much. There are much more "important" fields that weren't configured (such as the compression algorithm and whether or not to do integrity checks) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=202319102
This commit is contained in:
parent
bee3d6a5a4
commit
6ff48b7dae
15 changed files with 347 additions and 589 deletions
|
@ -65,13 +65,10 @@ final class ValidateEscrowDepositCommand implements Command {
|
|||
@Override
|
||||
public void run() throws Exception {
|
||||
if (input.toString().endsWith(".ghostryde")) {
|
||||
Ghostryde ghostryde = new Ghostryde(64 * 1024);
|
||||
try (InputStream in = Files.newInputStream(input);
|
||||
Ghostryde.Decryptor decryptor =
|
||||
ghostryde.openDecryptor(in, keyring.getRdeStagingDecryptionKey());
|
||||
Ghostryde.Decompressor decompressor = ghostryde.openDecompressor(decryptor);
|
||||
Ghostryde.Input ghostInput = ghostryde.openInput(decompressor)) {
|
||||
validateXmlStream(ghostInput);
|
||||
InputStream ghostrydeDecoder =
|
||||
Ghostryde.decoder(in, keyring.getRdeStagingDecryptionKey())) {
|
||||
validateXmlStream(ghostrydeDecoder);
|
||||
}
|
||||
} else {
|
||||
try (InputStream inputStream = Files.newInputStream(input)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue