Add common prefix function.
Redesign the write and read.