| 250 | } |
| 251 | |
| 252 | I64 LASwriterBIN::close(BOOL update_npoints) |
| 253 | { |
| 254 | I64 bytes = 0; |
| 255 | |
| 256 | if (stream) |
| 257 | { |
| 258 | if (update_npoints && p_count != npoints) |
| 259 | { |
| 260 | if (!stream->isSeekable()) |
| 261 | { |
| 262 | laserror("stream not seekable. cannot update header from %lld to %lld points.", npoints, p_count); |
| 263 | } |
| 264 | else |
| 265 | { |
| 266 | stream->seek(16); |
| 267 | stream->put32bitsLE((U8*)&p_count); |
| 268 | stream->seekEnd(); |
| 269 | } |
| 270 | } |
| 271 | bytes = stream->tell(); |
| 272 | delete stream; |
| 273 | stream = 0; |
| 274 | } |
| 275 | |
| 276 | if (file) |
| 277 | { |
| 278 | fclose(file); |
| 279 | file = 0; |
| 280 | } |
| 281 | |
| 282 | npoints = p_count; |
| 283 | p_count = 0; |
| 284 | |
| 285 | return bytes; |
| 286 | } |
| 287 | |
| 288 | LASwriterBIN::LASwriterBIN() |
| 289 | { |
nothing calls this directly
no test coverage detected