Not sure why this is an issue.
If you use ChannelBufferWrapper.writeString() and ChannelBufferWrapper.readString() it should handle all this for you.
Can you be more specific about where this problem occurs?
On second look, it is fine to use BufferHelper.sizeOfNullableSimpleString(String) to determine the size of the string *as long as we also use BufferHelper.writeAsSimpleString(Buffer, String) and not HornetQBuffer.writeString(String) directly*... not very intuitive...
PersistedDestination was the only class where it was not the case (hence the issue fixed yesterday).
Sounds pretty intuitive to me. If you encoded it as a SimpleString you can use sizeOfNullableSimpleString(), if you didn't encode it as a SimpleString you can't use sizeOfNullableSimpleString since it's... not encoded as a SimpleString.