Index: /OpenSceneGraph/trunk/src/osgPlugins/gz/ReaderWriterGZ.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/gz/ReaderWriterGZ.cpp (revision 10465)
+++ /OpenSceneGraph/trunk/src/osgPlugins/gz/ReaderWriterGZ.cpp (revision 11272)
@@ -174,5 +174,5 @@
     local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName));
 
-    std::ifstream fin(fileName.c_str());
+    std::ifstream fin(fileName.c_str(), std::ios::binary|std::ios::in);
     if (!fin) return ReadResult::ERROR_IN_READING_FILE;
     
@@ -252,5 +252,5 @@
     strm.next_in = Z_NULL;
     ret = inflateInit2(&strm,
-                       15 + 32 // autodected zlib or gzip header
+                       15 + 32 // autodetected zlib or gzip header
                        );
     if (ret != Z_OK)
@@ -260,5 +260,6 @@
     do {
 
-        strm.avail_in = fin.readsome((char*)in, CHUNK);
+        fin.read((char*)in, CHUNK);
+        strm.avail_in = fin.gcount();
 
         if (fin.fail())
