docs: public static int byteBufferSizeFor(INDArray arr) {
          if (!arr.isCompressed()) {
              ByteBuffer buffer = arr.data().pointer().asByteBuffer().order(ByteOrder.nativeOrder());
              ByteBuffer shapeBuffer = arr.shapeInfoDataBuffer().pointer().asByteBuffer().order(ByteOrder.nativeOrder());
              //2 four byte ints at the beginning
              int twoInts = 8;
              return twoInts + buffer.limit() + shapeBuffer.limit();
          } else {
              CompressedDataBuffer compressedDataBuffer = (CompressedDataBuffer) arr.data();
              CompressionDescriptor descriptor = compressedDataBuffer.getCompressionDescriptor();
              ByteBuffer codecByteBuffer = descriptor.toByteBuffer();
              ByteBuffer buffer = arr.data().pointer().asByteBuffer().order(ByteOrder.nativeOrder());
              ByteBuffer shapeBuffer = arr.shapeInfoDataBuffer().pointer().asByteBuffer().order(ByteOrder.nativeOrder());
              int twoInts = 2 * 4;
              return twoInts + buffer.limit() + shapeBuffer.limit() + codecByteBuffer.limit();
          }
      }