Jpp
JBinaryIO.hh
Go to the documentation of this file.
1 #ifndef __JLANG__JBINARYIO__
2 #define __JLANG__JBINARYIO__
3 
4 
5 /**
6  * \author mdejong
7  */
8 
9 namespace JLANG {}
10 namespace JPP { using namespace JLANG; }
11 
12 namespace JLANG {
13 
14 
15  /**
16  * Interface for binary input.
17  */
18  class JBinaryInput {
19  public:
20  /**
21  * Virtual destructor.
22  */
23  virtual ~JBinaryInput()
24  {}
25 
26 
27  /**
28  * Read byte array.
29  *
30  * \param buffer pointer to byte array
31  * \param length number of bytes
32  * \return number of bytes read
33  */
34  virtual int read(char* buffer, const int length) = 0;
35  };
36 
37 
38  /**
39  * Interface for binary output.
40  */
41  class JBinaryOutput {
42  public:
43  /**
44  * Virtual destructor.
45  */
46  virtual ~JBinaryOutput()
47  {}
48 
49 
50  /**
51  * Write byte array.
52  *
53  * \param buffer pointer to byte array
54  * \param length number of bytes
55  * \return number of bytes written
56  */
57  virtual int write(const char* buffer, const int length) = 0;
58  };
59 }
60 
61 #endif
JLANG::JBinaryOutput
Interface for binary output.
Definition: JBinaryIO.hh:41
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JLANG::JBinaryOutput::write
virtual int write(const char *buffer, const int length)=0
Write byte array.
JLANG::JBinaryInput::read
virtual int read(char *buffer, const int length)=0
Read byte array.
JLANG
Auxiliary classes and methods for language specific functionality.
Definition: JAbstractClass.hh:10
JLANG::JBinaryInput::~JBinaryInput
virtual ~JBinaryInput()
Virtual destructor.
Definition: JBinaryIO.hh:23
JLANG::JBinaryOutput::~JBinaryOutput
virtual ~JBinaryOutput()
Virtual destructor.
Definition: JBinaryIO.hh:46
JLANG::JBinaryInput
Interface for binary input.
Definition: JBinaryIO.hh:18