8 #include "EvtConstants.h"
22 data_ptr = &(bptr->data[0]);
24 max_size = max_length;
26 bptr->Bufseq = buffer_sequence;
33 fd =
open(_filename.c_str(), O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE ,
34 S_IRWXU | S_IROTH | S_IRGRP );
37 cout <<
" error opening file " << _filename << endl;
38 perror ( _filename.c_str());
50 int *
b = (
int *) bptr;
62 cout <<
"defunct oStream object " << endl;
70 if (irun>0) bptr->Runnr = irun;
84 cout <<
"defunct oStream object " << endl;
88 if ( ! has_buffer) prepare_next (buffer_sequence++, evt->
getRunNumber() );
99 evt->
Copy( &(bptr->data[current_index]), evtsize, &nw);
101 current_index += evtsize;
102 bptr->Length += evtsize*4;
110 if (has_end)
return -1;
111 bptr->data[current_index++] = 2;
112 bptr->data[current_index++] = 0;
123 if (!has_end) addEoB();
127 int blockcount = ( bptr->Length + 8192 -1)/8192;
128 int bytecount = blockcount*8192;
129 bytes =
writen (
fd, (
char *) bptr , bytecount );
138 unsigned int nleft, nwritten;
142 nwritten =
write (fd, ptr, nleft);
149 return (nbytes-nleft);