Implement early writing support
Replace C-style pointer casts with reinterpret_cast
Implement trivial truncate usage