-void gdcmBinEntry::Print(std::ostream &os) {
- PrintCommonPart(os);
- /// \todo Write a true specialisation of Print i.e. display something
- /// for BinEntry extension.
- dbg.Verbose(1, "gdcmBinEntry::Print: so WHAT ?");
+void gdcmBinEntry::Print(std::ostream &os)
+{
+ gdcmDocEntry::Print(os);
+ std::ostringstream s;
+ void *binArea = GetBinArea();
+ if (binArea)
+ {
+ //s << " [" << GDCM_BINLOADED
+ s << " [" << GetValue()
+ << "; length = " << GetLength() << "]";
+ }
+ else
+ {
+ if ( GetLength() == 0 )
+ {
+ s << " []";
+ }
+ else
+ {
+ //s << " [gdcm::Binary data NOT loaded]";
+ s << " [" <<GetValue() << "]";
+ }
+
+ }
+ os << s.str();
+}
+
+/*
+ * \brief canonical Writer
+ * @param fp already open file pointer
+ * @param filetype type of the file to be written
+*/
+void gdcmBinEntry::Write(FILE *fp, FileType filetype)
+{
+ gdcmDocEntry::Write(fp, filetype);
+ void *binArea = GetBinArea();
+ int lgr = GetLength();
+ if (binArea)
+ {
+ // there is a 'non string' LUT, overlay, etc
+ fwrite ( binArea,(size_t)lgr ,(size_t)1 ,fp); // Elem value
+ }
+ else
+ {
+ // nothing was loaded, but we need to skip space on disc
+ fseek(fp,(size_t)lgr,SEEK_CUR);
+ }