Why don't you read the complete string and then split it.