code: func NewMemoryMappedWriter(loc string, size int) (*MemoryMappedWriter, error) {
  	if _, err := os.Stat(loc); err == nil {
  		err = os.Remove(loc)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	// ensure destination directory exists
  	dir := filepath.Dir(loc)
  	err := os.MkdirAll(dir, 0700)
  	if err != nil {
  		return nil, err
  	}
  
  	f, err := os.OpenFile(loc, os.O_CREATE|os.O_RDWR|os.O_EXCL, 0644)
  	if err != nil {
  		return nil, err
  	}
  
  	l, err := f.Write(make([]byte, size))
  	if err != nil {
  		return nil, err
  	}
  	if l < size {
  		return nil, errors.Errorf("Could not initialize %d bytes", size)
  	}
  
  	b, err := mmap.Map(f, mmap.RDWR, 0)
  	if err != nil {
  		return nil, err
  	}
  
  	return &MemoryMappedWriter{
  		NewByteWriterSlice(b),
  		f,
  		loc,
  		size,
  	}, nil
  }
docs: // NewMemoryMappedWriter will create and return a new instance of a MemoryMappedWriter