| 97 | */ |
| 98 | |
| 99 | bool BlockDeviceOutputStream::checkFlush() { |
| 100 | |
| 101 | if(!_buffered || _indexInBlock==_device.getBlockSizeInBytes()) { |
| 102 | |
| 103 | // user wants us to flush, or we've run out of space in the block |
| 104 | |
| 105 | if(!_device.writeBlock(_block,_blockIndex)) |
| 106 | return false; |
| 107 | |
| 108 | // if run out of space, increment block and reset pointer |
| 109 | |
| 110 | if(_indexInBlock==_device.getBlockSizeInBytes()) { |
| 111 | _blockIndex++; |
| 112 | _indexInBlock=0; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | return true; |
| 117 | } |
| 118 | |
| 119 | |
| 120 | /** |
nothing calls this directly
no test coverage detected