Пример #1
0
        protected virtual void WriteVR_Binary(fo.DicomItem item, JsonWriter writer)
        {
            fo.IO.Buffer.IByteBuffer buffer = GetItemBuffer(item);


            if (buffer is fo.IO.Buffer.IBulkDataUriByteBuffer)
            {
                WriteBinaryValue(writer, ((fo.IO.Buffer.IBulkDataUriByteBuffer)buffer).BulkDataUri,
                                 JsonConstants.ELEMENT_BULKDATA);
            }
            else
            {
                if (this.WriteInlineBinary)
                {
                    WriteBinaryValue(writer,
                                     System.Convert.ToBase64String(buffer.Data),
                                     JsonConstants.ELEMENT_INLINEBINARY);
                }
            }
        }
Пример #2
0
        protected virtual void WriteVR_Binary(fo.DicomItem item, XmlWriter writer)
        {
            fo.IO.Buffer.IByteBuffer buffer = GetItemBuffer(item);

            if (buffer is fo.IO.Buffer.IBulkDataUriByteBuffer)
            {
                writer.WriteStartElement(Constants.ELEMENT_BULKDATA);
                //TODO: what about uuid? how is this represented in foDicom? fo.IO.Buffer.IBulkDataUUIDByteBuffer
                writer.WriteAttributeString(Constants.ATTRIBUTE_BULKDATAURI, ((fo.IO.Buffer.IBulkDataUriByteBuffer)buffer).BulkDataUri);
                writer.WriteEndElement( );
            }
            else
            {
                if (this.WriteInlineBinary)
                {
                    writer.WriteStartElement(Constants.ELEMENT_INLINEBINARY);
                    WriteStringValue(writer, buffer.Data);
                    writer.WriteEndElement( );
                }
            }
        }