Impelement write and read commands