| 147 | } |
| 148 | |
| 149 | void FileStream::setPosition(size_t position) |
| 150 | { |
| 151 | if (_mode == StreamMode::none) |
| 152 | { |
| 153 | throw Exception::InvalidOperation("Invalid mode"); |
| 154 | } |
| 155 | position = std::min(_length, static_cast<size_t>(position)); |
| 156 | fileSeek(_file, position, SEEK_SET); |
| 157 | _offset = position; |
| 158 | } |
| 159 | |
| 160 | void FileStream::read(void* buffer, size_t len) |
| 161 | { |