| 307 | |
| 308 | |
| 309 | void BpfReader::ready(PointTableRef) |
| 310 | { |
| 311 | m_istreamPtr = Utils::openFile(m_filename); |
| 312 | m_stream = ILeStream(m_istreamPtr); |
| 313 | m_stream.seek(m_header.m_len); |
| 314 | m_index = 0; |
| 315 | m_start = m_stream.position(); |
| 316 | #ifdef PDAL_HAVE_ZLIB |
| 317 | if (m_header.m_compression) |
| 318 | { |
| 319 | m_deflateBuf.resize(numPoints() * m_dims.size() * sizeof(float)); |
| 320 | size_t index = 0; |
| 321 | size_t bytesRead = 0; |
| 322 | do |
| 323 | { |
| 324 | bytesRead = readBlock(m_deflateBuf, index); |
| 325 | index += bytesRead; |
| 326 | } while (bytesRead > 0 && index < m_deflateBuf.size()); |
| 327 | m_charbuf.initialize(m_deflateBuf.data(), m_deflateBuf.size(), m_start); |
| 328 | m_stream.pushStream(new std::istream(&m_charbuf)); |
| 329 | } |
| 330 | #endif // PDAL_HAVE_ZLIB |
| 331 | } |
| 332 | |
| 333 | |
| 334 | void BpfReader::done(PointTableRef) |