本文整理汇总了C++中stream_type::get方法的典型用法代码示例。如果您正苦于以下问题:C++ stream_type::get方法的具体用法?C++ stream_type::get怎么用?C++ stream_type::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stream_type
的用法示例。
在下文中一共展示了stream_type::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readAlignmentGz
static bool readAlignmentGz(
stream_type & GZ,
::libmaus::bambam::BamAlignment & alignment,
::libmaus::bambam::BamHeader const * bamheader = 0,
bool const validate = true
)
{
/* read alignment block size */
int64_t const bs0 = GZ.get();
int64_t const bs1 = GZ.get();
int64_t const bs2 = GZ.get();
int64_t const bs3 = GZ.get();
if ( bs3 < 0 )
// reached end of file
return false;
/* assemble block size as LE integer */
alignment.blocksize = (bs0 << 0) | (bs1 << 8) | (bs2 << 16) | (bs3 << 24) ;
/* read alignment block */
if ( alignment.blocksize > alignment.D.size() )
alignment.D = ::libmaus::bambam::BamAlignment::D_array_type(alignment.blocksize,false);
GZ.read(reinterpret_cast<char *>(alignment.D.begin()),alignment.blocksize);
if ( static_cast<int64_t>(GZ.gcount()) != static_cast<int64_t>(alignment.blocksize) )
{
::libmaus::exception::LibMausException se;
se.getStream() << "Invalid alignment (EOF in alignment block of length " << alignment.blocksize << ")" << std::endl;
se.finish();
throw se;
}
if ( validate )
{
libmaus_bambam_alignment_validity const validity = bamheader ? alignment.valid(*bamheader) : alignment.valid();
if ( validity != ::libmaus::bambam::libmaus_bambam_alignment_validity_ok )
{
::libmaus::exception::LibMausException se;
se.getStream() << "Invalid alignment: " << validity << std::endl;
se.finish();
throw se;
}
}
return true;
}
示例2: blocklen
CompactFastQHeader(stream_type & stream)
:
blocklen(::libmaus::util::NumberSerialisation::deserialiseNumber(stream)),
numreads(::libmaus::util::NumberSerialisation::deserialiseNumber(stream)),
qbits(stream.get()),
quant(stream)
{
}
示例3: getByte
static uint8_t getByte(stream_type & in)
{
int const c = in.get();
if ( c < 0 )
{
::libmaus2::exception::LibMausException se;
se.getStream() << "Unexpected EOF in ::libmaus2::bambam::DecoderBase::getByte()" << std::endl;
se.finish();
throw se;
}
return c;
}
示例4: getLEInteger
static value_type getLEInteger(stream_type & stream)
{
value_type v = 0;
for ( uint64_t i = 0; i < length; ++i )
if ( stream.peek() == stream_type::traits_type::eof() )
{
libmaus2::exception::LibMausException ex;
ex.getStream() << "Failed to little endian number of length " << length << " in BamIndex::getLEInteger." << std::endl;
ex.finish();
throw ex;
}
else
{
v |= static_cast<value_type>(stream.get()) << (8*i);
}
return v;
}