binary IO

T

Thomas Matthews

dmitry said:
Hi All.
Where can I look for samples of binary stream?
I try ftp://ftp.fmi.uni-konstanz.de/pub/algo/personal/kuehl/binio.tar.gz
from gcc documentation
http://gcc.gnu.org/onlinedocs/libstdc++/27_io/binary_iostreams_kuehl.txt
but host ftp.fmi.uni-konstanz.de is unknown.

Thanks in advance,
Dmitry

Please expand on your definition of "binary stream".
Is this the same as opening a stream in binary mode?


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
D

David Harmon

Hi All.
Where can I look for samples of binary stream?
I try ftp://ftp.fmi.uni-konstanz.de/pub/algo/personal/kuehl/binio.tar.gz
from gcc documentation
http://gcc.gnu.org/onlinedocs/libstdc++/27_io/binary_iostreams_kuehl.txt
but host ftp.fmi.uni-konstanz.de is unknown.
[/QUOTE]
Please expand on your definition of "binary stream".
Is this the same as opening a stream in binary mode?

The article by Dietmar Kuhl, cited above, gives the idea. Did you read
it before asking?

Briefly, writing an object out to a binary stream IS a formatting
operation whether you like it or not. Therefore objects should be
written in a chosen representation, e.g. big_endian or little_endian for
ints, user format function for classes, regardless of internal byte
layout. ostream::write() etc. does not do any of this and so is
unsuitable for application programming purposes.

A binary stream would be a different class than existing iostreams,
would probably use the same streambuf classes, but would provide an
entirely different set of operator<< formatting actions and manipulators
for binary formatting.

I hope Dietmar may jump into the thread with a new ftp URL for his code,
so I am CC'ing him on this by email.
 
D

Dietmar Kuehl

It is a long time since I put the stuff there and in the meantime the
machine disappeared. I found the implementation, however, brushed it up
a little to compile with up to date compilers and put it at
<http://www.dietmar-kuehl.de/cxxrt/binio.tar.gz>. The code is written
about eight years ago and is not necessarily correct (it had no test
cases such that I can't easily check whether it still does the right
thing). However, I'm using binary formatting with great success in the
project I'm currently paid for. This is somewhat based on the binary
streams although I think only in idea, not implementation.
I hope Dietmar may jump into the thread with a new ftp URL for his code,
so I am CC'ing him on this by email.

CC'ing was a good idea: I didn't see this thread. I put the code on my
own site (see above).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,459
Latest member
Vida00R129

Latest Threads

Top