Fix readString() and writeString()

These methods contains a byte length handling.
Add method to EncodingBuffer and add tests