Add InputStream support

This is going to be used by datastore.