Read to string
(&mut self)
| 106 | |
| 107 | // Read to string |
| 108 | pub fn read_to_str(&mut self) -> String |
| 109 | { |
| 110 | let mut buffer = vec![0; self.size()]; |
| 111 | if let Ok(bytes) = self.read(&mut buffer) |
| 112 | { |
| 113 | buffer.resize(bytes, 0); |
| 114 | } |
| 115 | |
| 116 | String::from_utf8_lossy(&buffer).to_string() |
| 117 | } |
| 118 | |
| 119 | |
| 120 | // Seek |