MCPcopy Create free account
hub / github.com/PDAL/PDAL / startBlock

Method startBlock

io/BpfCompressor.cpp:41–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40#ifdef PDAL_HAVE_ZLIB
41void BpfCompressor::startBlock()
42{
43 // Initialize the stream.
44 m_strm.zalloc = Z_NULL;
45 m_strm.zfree = Z_NULL;
46 m_strm.opaque = Z_NULL;
47 if (deflateInit(&m_strm, Z_DEFAULT_COMPRESSION) != Z_OK)
48 throw error("Could not initialize BPF compressor.");
49
50 m_rawSize = 0;
51 m_compressedSize = 0;
52 uint32_t rawSize = 0;
53 uint32_t compressedSize = 0;
54
55 // Initiailize the streambuf with the backing buffer.
56 m_charbuf.initialize(m_inbuf.data(), m_inbuf.size());
57
58 // Note our position so that we can rewind here.
59 m_blockStart.mark();
60 m_out << rawSize << compressedSize;
61
62 // Make a new stream from our charbuf and push it so that future writes
63 // to our stream go to the backing vector.
64 m_out.pushStream(new std::ostream(&m_charbuf));
65}
66
67
68void BpfCompressor::compress()

Callers 3

writePointMajorMethod · 0.80
writeDimMajorMethod · 0.80
writeByteMajorMethod · 0.80

Calls 5

markMethod · 0.80
errorClass · 0.70
initializeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected