cleanup of IOService to use streams instead of byte[]
also throw proper exceptions for higher level handling