putBinary method

  1. @override
Future<AtResponse> putBinary(
  1. AtKey atKey,
  2. List<int> value, {
  3. PutRequestOptions? putRequestOptions,
})
override

put's the binary data(e.g. images, files etc) into the keystore

Implementation

@override
Future<AtResponse> putBinary(AtKey atKey, List<int> value,
    {PutRequestOptions? putRequestOptions}) async {
  try {
    // Setting metadata.isBinary to true for putBinary
    atKey.metadata.isBinary = true;
    // Base2e15.encode method converts the List<int> type to String.
    return await _putInternal(
        atKey, Base2e15.encode(value), putRequestOptions);
  } on AtException catch (e) {
    throw AtExceptionManager.createException(e);
  }
}