def writeClusters(start, buf, len = buf.length)
      clus = start; num, leftover = len.divmod(@bytesPerCluster); num += 1 if leftover > 0
      0.upto(num - 1) do |offset|
        local = buf[offset * @bytesPerCluster, @bytesPerCluster]
        if local.length < @bytesPerCluster then local += ("\0" * (@bytesPerCluster - local.length)) end
        @stream.seek(clusToByte(clus), IO::SEEK_SET)
        @stream.write(local, @bytesPerCluster)
        break if offset == num - 1 # ugly hack to prevent allocating more than needed.
        nxt = getFatEntry(clus)
        nxt = allocClusters(clus) if nxt > CC_END_OF_CHAIN
        clus = nxt
      end
    end
def writeClusters(start, buf, len = buf.length)
      clus = start; num, leftover = len.divmod(@bytesPerCluster); num += 1 if leftover > 0
      0.upto(num - 1) do |offset|
        local = buf[offset * @bytesPerCluster, @bytesPerCluster]
        if local.length < @bytesPerCluster then local += ("\0" * (@bytesPerCluster - local.length)) end
        @stream.seek(clusToByte(clus), IO::SEEK_SET)
        @stream.write(local, @bytesPerCluster)
        break if offset == num - 1 # ugly hack to prevent allocating more than needed.
        nxt = getFatEntry(clus)
        nxt = allocClusters(clus) if nxt > CC_END_OF_CHAIN
        clus = nxt
      end
    end
Start from defined cluster number and write data, following allocated cluster chain.