MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / makeStream

Method makeStream

src/openms/source/FORMAT/CompressedInputSource.cpp:116–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 CompressedInputSource::~CompressedInputSource() = default;
115
116 BinInputStream * CompressedInputSource::makeStream() const
117 {
118 if (head_[0] == 'B' && head_[1] == 'Z')
119 {
120 Bzip2InputStream * retStrm = new Bzip2InputStream(Internal::StringManager().convert(getSystemId()));
121 if (!retStrm->getIsOpen())
122 {
123 delete retStrm;
124 return nullptr;
125 }
126 return retStrm;
127 }
128 else /* (bz[0] == g1 && bz[1] == g2), where char g1 = 0x1f and char g2 = 0x8b */
129 {
130 GzipInputStream * retStrm = new GzipInputStream(Internal::StringManager().convert(getSystemId()));
131 if (!retStrm->getIsOpen())
132 {
133 delete retStrm;
134 return nullptr;
135 }
136 return retStrm;
137 }
138
139 }
140
141} // namespace OpenMS

Callers 1

Calls 2

convertMethod · 0.45
getIsOpenMethod · 0.45

Tested by

no test coverage detected