@ Nullable public byte [ ] getAsByteArray ( ) { try ( final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutputStream ( ) ) { if ( writeTo ( aBAOS ) . isFailure ( ) ) return null ; return aBAOS . getBufferOrCopy ( ) ; } }
Helper method to get the whole workbook as a single byte array .