Package org.apache.hadoop.crypto
Class CryptoStreamUtils
java.lang.Object
org.apache.hadoop.crypto.CryptoStreamUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcheckBufferSize(CryptoCodec codec, int bufferSize) Check and floor buffer size.static voidcheckCodec(CryptoCodec codec) AES/CTR/NoPadding or SM4/CTR/NoPadding is required.static voidfreeDB(ByteBuffer buffer) Forcibly free the direct buffer.static intgetBufferSize(Configuration conf) Read crypto buffer size.static longIf input stream isSeekable, return it's current position, otherwise return 0;
-
Constructor Details
-
CryptoStreamUtils
public CryptoStreamUtils()
-
-
Method Details
-
freeDB
Forcibly free the direct buffer.- Parameters:
buffer- buffer.
-
getBufferSize
Read crypto buffer size.- Parameters:
conf- configuration.- Returns:
- hadoop.security.crypto.buffer.size.
-
checkCodec
AES/CTR/NoPadding or SM4/CTR/NoPadding is required.- Parameters:
codec- crypto codec.
-
checkBufferSize
Check and floor buffer size.- Parameters:
codec- crypto codec.bufferSize- the size of the buffer to be used.- Returns:
- calc buffer size.
-
getInputStreamOffset
If input stream isSeekable, return it's current position, otherwise return 0;- Parameters:
in- wrapper.- Returns:
- current position, otherwise return 0.
- Throws:
IOException- raised on errors performing I/O.
-