NPOI version 2.2+ MemoryStream.ToArray() 0 bytes

Using NPOI version, this line works perfectly, returning a a byte array with data: workbook is an XSSFWorkbook

using (var memoryStream = new MemoryStream())
    return  memoryStream.ToArray();

when upgrading to 2.2 (and 2.3), this no longer returns any data, the byte array has 0 bytes. no exceptions are thrown, it just silently fails to write data.

Is there a new way to write this workbook out in the updated version?