コード例 #1
0
// UnParse the box to the stream
CNCSError CNCSJP2File::CNCSJP2GMLGeoLocationBox::UnParse(class CNCSJP2File &JP2File, CNCSJPCIOStream &Stream)
{
#ifdef NCS_BUILD_WITH_STDERR_DEBUG_INFO
    fprintf(stderr,"UnParsing GML box information\n");
#endif


    char buf[1024];
    CNCSError Error = FormatXML(buf, sizeof(buf));

    if(Error == NCS_SUCCESS) {
        Error = CNCSJP2Box::UnParse(JP2File, Stream);
        NCSJP2_CHECKIO_BEGIN(Error, Stream);
        Stream.Write(buf, (UINT32)strlen(buf));
        NCSJP2_CHECKIO_END();
    }
    return(Error);
}
コード例 #2
0
ファイル: NCSJPCCodeBlock.cpp プロジェクト: forostm/libecw
INT32 CNCSJPCCodeBlock::WriteNewSegs(CNCSJPCIOStream &Stream)
{
	INT32 nWritten = 0;
	UINT32 nNewSegs = (UINT32)m_NextSegments.size();
	if(nNewSegs) {
		for(UINT32 i = 0; i < nNewSegs; i++) {
			CNCSJPCSegment &Seg = m_NextSegments[i];

			if(Stream.Write(Seg.m_pData, Seg.m_nLength) == false) {
				// Read error;
				nWritten = -1;
				break;
			}
			nWritten += Seg.m_nLength;

			sm_Tracker.RemoveMem(Seg.m_nLength);
		}
		m_NextSegments.clear();
	}
	return(nWritten);
}