You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/08/05 16:19:21 UTC
[commons-crypto] 01/02: No need to override stock methods and
implement them exactly the same way.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git
commit c479c5249fcea07fcec172d1b527d3c439c4b58b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Aug 5 12:17:18 2020 -0400
No need to override stock methods and implement them exactly the same
way.
---
.../commons/crypto/stream/CryptoInputStream.java | 24 +---------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java b/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java
index ff8912f..37e1012 100644
--- a/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java
+++ b/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java
@@ -116,6 +116,7 @@ public class CryptoInputStream extends InputStream implements
* @param params the algorithm parameters.
* @throws IOException if an I/O error occurs.
*/
+ @SuppressWarnings("resource") // The CryptoCipher returned by getCipherInstance() is closed by CryptoInputStream.
public CryptoInputStream(final String transformation,
final Properties props, final InputStream in, final Key key,
final AlgorithmParameterSpec params) throws IOException {
@@ -353,29 +354,6 @@ public class CryptoInputStream extends InputStream implements
}
/**
- * Overrides the {@link java.io.InputStream#mark(int)}. For
- * {@link CryptoInputStream},we don't support the mark method.
- *
- * @param readlimit the maximum limit of bytes that can be read before the
- * mark position becomes invalid.
- */
- @Override
- public void mark(final int readlimit) {
- // noop
- }
-
- /**
- * Overrides the {@link InputStream#reset()}. For {@link CryptoInputStream}
- * ,we don't support the reset method.
- *
- * @throws IOException if an I/O error occurs.
- */
- @Override
- public void reset() throws IOException {
- throw new IOException("Mark/reset not supported");
- }
-
- /**
* Overrides the {@link InputStream#markSupported()}.
*
* @return false,the {@link CtrCryptoInputStream} don't support the mark