MCPcopy Create free account
hub / github.com/OpenGene/fastp / writeInternal

Method writeInternal

src/writer.cpp:110–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110bool Writer::writeInternal(const char* strdata, size_t size) {
111 size_t written;
112 bool status;
113
114 if(mZipped){
115 size_t bound = libdeflate_gzip_compress_bound(mCompressor, size);
116 void* out = malloc(bound);
117 size_t outsize = libdeflate_gzip_compress(mCompressor, strdata, size, out, bound);
118 if(outsize == 0)
119 status = false;
120 else {
121 size_t ret = fwrite(out, 1, outsize, mFP );
122 status = ret>0;
123 //mOutStream->write((char*)out, outsize);
124 //status = !mOutStream->fail();
125 }
126 free(out);
127 }
128 else{
129 size_t ret = fwrite(strdata, 1, size, mFP );
130 status = ret>0;
131 }
132 return status;
133}
134
135void Writer::close(){
136 if (mZipped){

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected