WampFileSource.bytes constructor

WampFileSource.bytes(
  1. Uint8List bytes, {
  2. required String name,
  3. String? contentType,
  4. String? sha256Digest,
  5. Map<String, dynamic>? custom,
})

Implementation

factory WampFileSource.bytes(
  Uint8List bytes, {
  required String name,
  String? contentType,
  String? sha256Digest,
  Map<String, dynamic>? custom,
}) {
  return WampFileSource(
    name: name,
    length: bytes.length,
    openRead: () => Stream<Uint8List>.value(bytes),
    contentType: contentType,
    sha256Digest: sha256Digest,
    custom: custom,
  );
}