CountingInputStream,s method getCount() not giving any values
<p>i am reading the bytes from binary file and now i have to get the index position of the stream and i am using CountingInputStream class and method getByteCount but this method returning me 0.</p>

<p>Here is my Code.</p>

<pre><code>public void readIndex(InputStream iStream)
  {
   SwappedDataInputStream input;
   input = new SwappedDataInputStream(iStream);
   int locKey;
   int x=0;
   int y=0;

   try{
   setINoOfTiles(input.readInt());
   CountingInputStream cis = new CountingInputStream(iStream);

   for(int i=0; i&lt;iNoOfTiles; i++)
   {
    x  = input.readInt()/100;
    y =input.readInt()/100;
    MapTileHeader tTile = new MapTileHeader(x, y, mapType);
    locKey = input.readInt();
    HashMap&lt;Integer, MapTileHeader&gt; iTileListOffsets = new HashMap&lt;Integer, MapTileHeader&gt;();
    iTileListOffsets.put(locKey, tTile);       
   }

   String out = IOUtils.toString(cis);
   long count = cis.getByteCount(); 
   Log.i("count", "count =" + count);
   }catch(Exception e )
   {
    e.printStackTrace();
   }
  }
</code></pre>
