Java错误不兼容类型InputStream无法转换为Serializable

时间:2017-07-11 05:39:51

标签: serializable

当在oaf中使用invoke方法从AM调用方法时,我有一个输入流变量要传递,而使用serializable传递参数我面临java错误不兼容的类型,说输入流不能转换为serializable.Is那里传递值的任何其他方法。请帮助。谢谢。

 try {  
     DataObject fileUploadData = pageContext.getNamedDataObject("Upload");
       if (fileUploadData != null) {
           String FileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
           String contentType = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
           BlobDomain uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null, FileName);
       BoxDeveloperEditionAPIConnection api=(BoxDeveloperEditionAPIConnection)oam.invokeMethod("adminClient");

           **Serializable parameters[]={entityName,key, FileName,uploadedByteStream.getInputStream(),api};**    // Incompatible type error found for the last two values.Expecting serializable but found Input stream and api.
           BoxFile.Info file = (BoxFile.Info)oam.invokeMethod("UploadFile",parameters);
           return file;
        } else {
             pageContext.putDialogMessage(new OAException("Please choose the file",  OAException.ERROR));
          }
  }   

0 个答案:

没有答案