Commit 6d3887b9 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

some notes on binary I/O

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/branches/libdatrwxx.su
SVN Revision: 3457
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent ab17108c
......@@ -262,7 +262,7 @@ Usually input stream classes for data formats containing floating point
values for the samples do not provide integer type \em series \em query
\em functions.
\subsection subsec_howtoworks_tracedata Reading a trace header
\subsection subsec_howtoworks_traceheader Reading a trace header
While parsing the trace data, the input stream classes collect trace header
information.
After returning the samples, this data is available through the
......@@ -351,6 +351,8 @@ The operators are provided in namespace ::datrw.
file streams in binary mode if appropriate; the readany and writeany
modules have to provide functions, which return an approrpiate flag if the
format specifier is passed
- the libstdc++ documentation recommends to use stream buffers directly
for binary I/O (see also \ref sec_binary_io)
\section sec_file_format_parameters Introduce file format parameters
......@@ -374,6 +376,24 @@ The operators are provided in namespace ::datrw.
writing to file, to avoid accumulation of such header fields in the FREE
block due to reading the written file again.
\section sec_binary_io I/O for binary data formats
Currently the library uses stream function read and write for binary output
in modules like the \ref mseed.
These functions apparently are remainders of a pre-standard implementation
of streams (prior to the invention of stream buffers).
The GNU libstdc++ documentations recommends to do binary I/O on the
stream-buffer level, since streams themselves are not meant to do binary
I/O.
Nevertheless binary I/O appears to work with the read and write functions of
streams.
However, these functions operate on values of type \c char.
This could mean that the would still do some kind of character translation,
which we do not like when reading binary seismic data.
The stream buffer operations are also defined for character data.
I currently cannot find sufficient documentation to understand whether there
is a risk of input or output data being translated with input streams opened
in binary mode.
*/
// ----- END OF README -----
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment