59 #include <XrdClient/XrdClient.hh>
60 #include "XrdClient/XrdClientEnv.hh"
61 #include "XrdSys/XrdSysHeaders.hh"
78 std::ifstream inputStream;
79 std::string remoteAddress;
89 virtual long size(){
return 0;}
98 virtual void open(
const char *filename){}
111 std::ifstream inputStream;
119 if(inputStream.is_open()==
true){
126 long pos = inputStream.tellg();
127 inputStream.seekg(0,std::ios_base::end);
128 long lastpos = inputStream.tellg();
129 inputStream.seekg(pos,std::ios_base::beg);
135 void open(
const char *filename){
136 inputStream.open(filename, std::ios::binary);
143 long position(
long pos){ inputStream.seekg(pos,std::ios_base::beg);
return pos; }
157 kXR_unt16 open_mode = (kXR_ur);
158 kXR_unt16 open_opts = (1);
159 XrdClient *cli = NULL;
161 long streamPosition = 0;
180 void open(
const char *filename);
Data stream implementation for local file I/O using std::ifstream.
datastreamLocalFile()
Default constructor.
void open(const char *filename)
Open a local file for binary reading.
int read(char *s, int size)
Read bytes from the file.
long position(long pos)
Seek to the given byte position.
~datastreamLocalFile()
Destructor; closes the file if open.
Data stream implementation for XRootD remote file access.
~datastreamXrootd()
Destructor; closes the remote connection.
void open(const char *filename)
Open a remote file via XRootD.
datastreamXrootd()
Default constructor.
int read(char *s, int size)
Read bytes from the remote file.
Abstract base class for data stream I/O.
virtual int read(char *s, int size)
Read bytes from the stream.
virtual void open(const char *filename)
Open a data source.
virtual long position(long pos)
Seek to a position in the stream.