Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:46

0001 #include "Utilities/StorageFactory/test/Test.h"
0002 #include "Utilities/StorageFactory/interface/Storage.h"
0003 #include "FWCore/Utilities/interface/Exception.h"
0004 #include <cassert>
0005 
0006 int main(int, char** /*argv*/) try {
0007   initTest();
0008 
0009   using namespace edm::storage;
0010   IOSize n;
0011   char buf[1024];
0012   auto s = StorageFactory::get()->open("http://google.com", IOFlags::OpenRead);
0013 
0014   assert(s);
0015   while ((n = s->read(buf, sizeof(buf))))
0016     std::cout.write(buf, n);
0017 
0018   s->close();
0019 
0020   std::cerr << StorageAccount::summaryText(true) << std::endl;
0021   return EXIT_SUCCESS;
0022 } catch (cms::Exception const& e) {
0023   std::cerr << e.explainSelf() << std::endl;
0024   return EXIT_FAILURE;
0025 } catch (std::exception const& e) {
0026   std::cerr << e.what() << std::endl;
0027   return EXIT_FAILURE;
0028 }