Wouldn't this fail in the case of: abc~9~1389728233  ?

In that case the first part would be "abc~9" and the second "1389728233" ... I belive this will reset the bytebuffer and return false.