fix ReadEndsContainer for gcc 4.8 by explicitely calling flush on output stream