Interface IByteArrayDecoder

    • Method Detail

      • getMaximumDecodedLength

        @Nonnegative
        default int getMaximumDecodedLength​(@Nonnegative
                                            int nEncodedLen)
        Get the maximum decoded length based on the provided encoded length. This is purely for performance reasons.
        Parameters:
        nEncodedLen - The encoded length. Always ≥ 0.
        Returns:
        The maximum decoded length. Always ≥ 0.
        Since:
        9.3.6
      • getDecoded

        @Nullable
        @ReturnsMutableCopy
        default byte[] getDecoded​(@Nullable
                                  byte[] aEncodedBuffer)
        Decode a byte array.
        Specified by:
        getDecoded in interface IDecoder<byte[],​byte[]>
        Parameters:
        aEncodedBuffer - The byte array to be decoded. May be null.
        Returns:
        The decoded byte array or null if the parameter was null.
        Throws:
        DecodeException - in case something goes wrong
      • getDecoded

        @Nullable
        @ReturnsMutableCopy
        byte[] getDecoded​(@Nullable
                          byte[] aEncodedBuffer,
                          @Nonnegative
                          int nOfs,
                          @Nonnegative
                          int nLen)
        Decode a byte array.
        Parameters:
        aEncodedBuffer - The byte array to be decoded. May be null.
        nOfs - Offset into the byte array to start from.
        nLen - Number of bytes starting from offset to consider.
        Returns:
        The decoded byte array or null if the parameter was null.
        Throws:
        DecodeException - in case something goes wrong
      • getDecoded

        @Nullable
        @ReturnsMutableCopy
        default byte[] getDecoded​(@Nullable
                                  String sEncoded,
                                  @Nonnull
                                  Charset aCharset)
        Decode the passed string.
        Parameters:
        sEncoded - The string to be decoded. May be null.
        aCharset - The charset to be used. May not be null.
        Returns:
        null if the input string is null.
        Throws:
        DecodeException - in case something goes wrong