()
| 63 | } |
| 64 | |
| 65 | private void loadFromStorage(){ |
| 66 | DataInputStream inputStream=NvStorage.ReadFileRecord("stats", 0); |
| 67 | try { |
| 68 | traffic=inputStream.readLong(); |
| 69 | latestTraffic=inputStream.readLong(); |
| 70 | sessions=inputStream.readInt(); |
| 71 | inputStream.close(); |
| 72 | inputStream=null; |
| 73 | } catch (Exception e) { |
| 74 | try { |
| 75 | if (inputStream!=null) { |
| 76 | inputStream.close(); |
| 77 | inputStream=null; |
| 78 | } |
| 79 | } catch (IOException ex) {} |
| 80 | } |
| 81 | sessions++; |
| 82 | } |
| 83 | |
| 84 | public void saveToStorage(boolean reset){ |
| 85 | loadFromStorage(); |
no test coverage detected