pub fn calculate_byte_len(&self) -> usize {
        use self::PrimitiveValue::*;
        match self {
            Empty => 0,
            U8(c) => c.len(),
            I16(c) => c.len() * 2,
            U16(c) => c.len() * 2,
            U32(c) => c.len() * 4,
            I32(c) => c.len() * 4,
            U64(c) => c.len() * 8,
            I64(c) => c.len() * 8,
            F32(c) => c.len() * 4,
            F64(c) => c.len() * 8,
            Tags(c) => c.len() * 4,
            Date(c) => c.len() * 8,
            Str(s) => s.as_bytes().len(),
            Strs(c) if c.is_empty() => 0,
            Strs(c) => {
                c.iter()
                    .map(|s| ((s.as_bytes().len() + 1) & !1) + 1)
                    .sum::<usize>()
                    - 1
            }
            Time(c) if c.is_empty() => 0,
            Time(c) => {
                c.iter()
                    .map(|t| ((PrimitiveValue::tm_byte_len(*t) + 1) & !1) + 1)
                    .sum::<usize>()
                    - 1
            }
            DateTime(c) if c.is_empty() => 0,
            DateTime(c) => {
                c.iter()
                    .map(|dt| ((PrimitiveValue::dt_byte_len(*dt) + 1) & !1) + 1)
                    .sum::<usize>()
                    - 1
            }
        }
    }
/// Determine the minimum number of bytes that this value would need to
/// occupy in a DICOM file, without compression and without the header.
/// As mandated by the standard, it is always even.
/// The calculated number does not need to match the size of the original
/// byte stream.
Determine the minimum number of bytes that this value would need to
occupy in a DICOM file, without compression and without the header.
As mandated by the standard, it is always even.
The calculated number does not need to match the size of the original
byte stream.
Determine the minimum number of bytes that this value would need to occupy in a DICOM file without compression and without the header . As mandated by the standard it is always even . The calculated number does not need to match the size of the original byte stream .
pub fn calculate_byte_len(&self) -> usize {
        use self::PrimitiveValue::*;
        match self {
            Empty => 0,
            U8(c) => c.len(),
            I16(c) => c.len() * 2,
            U16(c) => c.len() * 2,
            U32(c) => c.len() * 4,
            I32(c) => c.len() * 4,
            U64(c) => c.len() * 8,
            I64(c) => c.len() * 8,
            F32(c) => c.len() * 4,
            F64(c) => c.len() * 8,
            Tags(c) => c.len() * 4,
            Date(c) => c.len() * 8,
            Str(s) => s.as_bytes().len(),
            Strs(c) if c.is_empty() => 0,
            Strs(c) => {
                c.iter()
                    .map(|s| ((s.as_bytes().len() + 1) & !1) + 1)
                    .sum::<usize>()
                    - 1
            }
            Time(c) if c.is_empty() => 0,
            Time(c) => {
                c.iter()
                    .map(|t| ((PrimitiveValue::tm_byte_len(*t) + 1) & !1) + 1)
                    .sum::<usize>()
                    - 1
            }
            DateTime(c) if c.is_empty() => 0,
            DateTime(c) => {
                c.iter()
                    .map(|dt| ((PrimitiveValue::dt_byte_len(*dt) + 1) & !1) + 1)
                    .sum::<usize>()
                    - 1
            }
        }
    }
pub fn calculate_byte_len ( & self ) -> usize { use self :: PrimitiveValue :: * ; match self { Empty => 0 , U8 ( c ) => c . len ( ) , I16 ( c ) => c . len ( ) * 2 , U16 ( c ) => c . len ( ) * 2 , U32 ( c ) => c . len ( ) * 4 , I32 ( c ) => c . len ( ) * 4 , U64 ( c ) => c . len ( ) * 8 , I64 ( c ) => c . len ( ) * 8 , F32 ( c ) => c . len ( ) * 4 , F64 ( c ) => c . len ( ) * 8 , Tags ( c ) => c . len ( ) * 4 , Date ( c ) => c . len ( ) * 8 , Str ( s ) => s . as_bytes ( ) . len ( ) , Strs ( c ) if c . is_empty ( ) => 0 , Strs ( c ) => { c . iter ( ) . map ( | s | ( ( s . as_bytes ( ) . len ( ) + 1 ) & ! 1 ) + 1 ) . sum :: < usize > ( ) - 1 } Time ( c ) if c . is_empty ( ) => 0 , Time ( c ) => { c . iter ( ) . map ( | t | ( ( PrimitiveValue :: tm_byte_len ( * t ) + 1 ) & ! 1 ) + 1 ) . sum :: < usize > ( ) - 1 } DateTime ( c ) if c . is_empty ( ) => 0 , DateTime ( c ) => { c . iter ( ) . map ( | dt | ( ( PrimitiveValue :: dt_byte_len ( * dt ) + 1 ) & ! 1 ) + 1 ) . sum :: < usize > ( ) - 1 } } }
Determine the minimum number of bytes that this value would need to
occupy in a DICOM file, without compression and without the header.
Determine the minimum number of bytes that this value would need to occupy in a DICOM file without compression and without the header .
&self
&self