public void Dispose() { WriteBlock(_buffer, 0, _bufferCount); _writer?.Dispose(); _writer = null; }
public void put(string key, string value) { File file = mCache.newFile(key); BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(file), 1024); writer.Write(value); } catch (IOException ex) { ex.PrintStackTrace(); } finally { if (writer != null) { try { writer.Flush(); writer.Dispose(); } catch (IOException ex) { ex.PrintStackTrace(); } } mCache.put(file); } }
public void Dispose() { if (_writer != null) { // Write the map at the end of the index WriteIndexMap(); _writer.Dispose(); _writer = null; } }
public void Dispose() { if (_writer != null) { _writer.Dispose(); _writer = null; } if (_compressor != null) { _compressor.Dispose(); _compressor = null; } }