@FunctionalInterface public interface IByteArrayEncoder extends IEncoder<byte[],byte[]>
Modifier and Type | Method and Description |
---|---|
default byte[] |
getEncoded(byte[] aDecodedBuffer)
Encode a byte array.
|
byte[] |
getEncoded(byte[] aDecodedBuffer,
int nOfs,
int nLen)
Encode a byte array.
|
default byte[] |
getEncoded(String sDecoded,
Charset aCharset)
Encode the passed string.
|
default int |
getEncodedLength(int nDecodedLen)
Deprecated.
Use
getMaximumEncodedLength(int) instead |
default int |
getMaximumEncodedLength(int nDecodedLen)
Get the maximum encoded length based on the provided decoded length.
|
@Nonnegative @Deprecated default int getEncodedLength(@Nonnegative int nDecodedLen)
getMaximumEncodedLength(int)
insteadnDecodedLen
- The decoded length. Always ≥ 0.@Nonnegative default int getMaximumEncodedLength(@Nonnegative int nDecodedLen)
nDecodedLen
- The decoded length. Always ≥ 0.@Nullable @ReturnsMutableCopy default byte[] getEncoded(@Nullable byte[] aDecodedBuffer)
getEncoded
in interface IEncoder<byte[],byte[]>
aDecodedBuffer
- The byte array to be encoded. May be null
.null
if the parameter was
null
.EncodeException
- In case something goes wrong@Nullable @ReturnsMutableCopy byte[] getEncoded(@Nullable byte[] aDecodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen)
aDecodedBuffer
- The byte array to be encoded. May be null
.nOfs
- Offset into the byte array to start from.nLen
- Number of bytes starting from offset to consider.null
if the parameter was
null
.EncodeException
- In case something goes wrong@Nullable @ReturnsMutableCopy default byte[] getEncoded(@Nullable String sDecoded, @Nonnull Charset aCharset)
sDecoded
- The string to be encoded. May be null
.aCharset
- The charset to be used. May not be null
.null
if the input string is null
.EncodeException
- In case something goes wrongCopyright © 2014–2019 Philip Helger. All rights reserved.