@Override public long addFile(String fileName,InputStream inputStream,long fileSize) throws IOException, NameTakenException, InternalException {
  try {
    String imagePath=getImageFilePath(fileName);
    logger.info("write to {}",imagePath);
    try (NfcFileOutputStream outputStream=nfcClient.putFile(imagePath,fileSize)){
      for (int i=0; i < fileSize; i++) {
        outputStream.write(inputStream.read());
      }
    }
     return fileSize;
  }
  finally {
    if (inputStream != null) {
      inputStream.close();
    }
  }
}

@ Override public long addFile ( String fileName , InputStream inputStream , long fileSize ) throws IOException , NameTakenException , InternalException { try { String imagePath = getImageFilePath ( fileName ) ; logger . info ( "write to {}" , imagePath ) ; try ( NfcFileOutputStream outputStream = nfcClient . putFile ( imagePath , fileSize ) ) { for ( int i = 0 ; i < fileSize ; i ++ ) { outputStream . write ( inputStream . read ( ) ) ; } } return fileSize ; } finally { if ( inputStream != null ) { inputStream . close ( ) ; } } }
upload file to remote datastore . if the file name exists in the datastore , it will be overwritten . a typical datastore path for image id 123456789 is : [ datastore1 ] tmp_upload_123456789 / [ filename ]
