如何从缓冲区返回文件流?

我已经存储了图像,它的大小(以字节为单位)及其类型存储在mysql数据库中。

当我获取它时,我正在获取图像的缓冲区,现在我试图弄清楚如何将其发送回我的客户端,以便它呈现图像?

我的路线内的代码:

  const img = await db.images.findByPk(parser.setValueAsBIN(p.id));

   const myReadableStreamBuffer = new streamBuffers.ReadableStreamBuffer({
    frequency: 10, // in milliseconds.
    chunkSize: img.Length, // in bytes.
  });



 myReadableStreamBuffer.put(img.dataValues.imageData);

下一步是什么?

If I would to log myReadableStreamBuffer

我得到:

Readable {   _readableState:    ReadableState {
     objectMode: false,
     highWaterMark: 16384,
     buffer: BufferList { head: null, tail: null, length: 0 },
     length: 0,
     pipes: null,
     pipesCount: 0,
     flowing: null,
     ended: false,
     endEmitted: false,
     reading: false,
     sync: true,
     needReadable: false,
     emittedReadable: false,
     readableListening: false,
     resumeScheduled: false,
     paused: true,
     emitClose: true,
     autoDestroy: false,
     destroyed: false,
     defaultEncoding: 'utf8',
     awaitDrain: 0,
     readingMore: false,
     decoder: null,
     encoding: null },   readable: true,   domain: null,   _events: [Object: null prototype] {},   _eventsCount: 0,   _maxListeners: undefined,   stopped: false,   stop: [Function],   size: [Function],   maxSize: [Function],   put: [Function],   _read: [Function] }