cannot cast InputStream to ObjectStream

same as Output