` if (length == 0) ` in writeTo?