rename writeAll as write