@FunctionalInterface public interface IByteArrayStreamEncoder extends IByteArrayEncoder
| Modifier and Type | Method and Description |
|---|---|
void |
encode(byte[] aDecodedBuffer,
int nOfs,
int nLen,
OutputStream aOS)
Encode (part of) a byte array to an
OutputStream. |
default void |
encode(byte[] aDecodedBuffer,
OutputStream aOS)
Encode a byte array to an
OutputStream. |
default byte[] |
getEncoded(byte[] aDecodedBuffer)
Encode a byte array.
|
default byte[] |
getEncoded(byte[] aDecodedBuffer,
int nOfs,
int nLen)
Encode a byte array.
|
default byte[] |
getEncoded(String sDecoded,
Charset aCharset)
Encode the passed string.
|
default String |
getEncodedAsString(byte[] aDecodedBuf,
Charset aCharset) |
default String |
getEncodedAsString(byte[] aDecodedBuf,
int nOfs,
int nLen,
Charset aCharset) |
default String |
getEncodedAsString(String sDecoded,
Charset aCharset)
Encode the passed string and return the result as a String.
|
default int |
getMaximumEncodedLength(int nDecodedLen)
Get the maximum encoded length based on the provided decoded length.
|
getEncodedLength@Nonnegative default int getMaximumEncodedLength(@Nonnegative int nDecodedLen)
IByteArrayEncodergetMaximumEncodedLength in interface IByteArrayEncodernDecodedLen - The decoded length. Always ≥ 0.default void encode(@Nullable byte[] aDecodedBuffer, @Nonnull @WillNotClose OutputStream aOS)
OutputStream.aDecodedBuffer - The byte array to be encoded. May be null.aOS - The output stream to write to. May not be null and is
NOT closed afterwards!EncodeException - In case something goes wrongvoid encode(@Nullable byte[] aDecodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull @WillNotClose OutputStream aOS)
OutputStream.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.aOS - The output stream to write to. May not be null and is
NOT closed afterwards!EncodeException - In case something goes wrong@Nullable @ReturnsMutableCopy default byte[] getEncoded(@Nullable byte[] aDecodedBuffer)
getEncoded in interface IByteArrayEncodergetEncoded 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 default byte[] getEncoded(@Nullable byte[] aDecodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen)
getEncoded in interface IByteArrayEncoderaDecodedBuffer - 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)
getEncoded in interface IByteArrayEncodersDecoded - 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 wrong@Nullable default String getEncodedAsString(@Nullable byte[] aDecodedBuf, @Nonnull Charset aCharset)
@Nullable default String getEncodedAsString(@Nullable byte[] aDecodedBuf, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull Charset aCharset)
@Nullable default String getEncodedAsString(@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.