Add getLine and writeLine methods