(Object name,
StreamOptions options,
PhysicalWriter.OutputReceiver receiver)
| 73 | private final byte[] iv; |
| 74 | |
| 75 | public OutStream(Object name, |
| 76 | StreamOptions options, |
| 77 | PhysicalWriter.OutputReceiver receiver) { |
| 78 | this.name = name; |
| 79 | this.bufferSize = options.getBufferSize(); |
| 80 | this.codec = options.getCodec(); |
| 81 | this.options = options.getCodecOptions(); |
| 82 | this.receiver = receiver; |
| 83 | if (options.isEncrypted()) { |
| 84 | this.cipher = options.getAlgorithm().createCipher(); |
| 85 | this.key = options.getKey(); |
| 86 | this.iv = options.getIv(); |
| 87 | resetState(); |
| 88 | } else { |
| 89 | this.cipher = null; |
| 90 | this.key = null; |
| 91 | this.iv = null; |
| 92 | } |
| 93 | LOG.debug("Stream {} written to with {}", name, options); |
| 94 | logKeyAndIv(name, key, iv); |
| 95 | } |
| 96 | |
| 97 | static void logKeyAndIv(Object name, Key key, byte[] iv) { |
| 98 | if (iv != null && KEY_LOGGER.isDebugEnabled()) { |
nothing calls this directly
no test coverage detected