/* * Copyright (C) 2007-2012 Xagasoft, All rights reserved. * * This file is part of the libgats library and is released under the * terms of the license contained in the file LICENSE. */ #include #include #include #include using namespace Bu; int main( int argc, char *argv[] ) { File fIn( argv[1], File::Read ); Gats::GatsStream gsIn( fIn ); for(;;) { sio << "Reading from file position: " << fIn.tell() << sio.nl; Gats::Object *pObj = gsIn.readObject(); if( !pObj ) { if( gsIn.hasReadBuffer() ) { sio << "Premature end of stream detected, have " << gsIn.getReadBufferSize() << "b." << sio.nl; } return 0; } sio << *pObj << sio.nl; } }