33 VL(uint32_t vl = 0) : ValueLength(vl) { }
40 return ValueLength == 0xFFFFFFFF;
43 ValueLength = 0xFFFFFFFF;
48 return !IsUndefined() && ValueLength % 2;
53 ValueLength += vl.ValueLength;
61 uint32_t tmp(ValueLength);
66 operator uint32_t ()
const {
return ValueLength; }
74 friend std::ostream&
operator<<(std::ostream& os,
const VL& vl);
79 template <
typename TSwap>
80 std::istream &Read(std::istream &is)
82 is.read((
char*)(&ValueLength),
sizeof(uint32_t));
83 TSwap::SwapArray(&ValueLength,1);
87 template <
typename TSwap>
88 std::istream &Read16(std::istream &is)
91 is.read((
char*)(©),
sizeof(uint16_t));
92 TSwap::SwapArray(©,1);
94 assert( ValueLength <= 65535 );
98 template <
typename TSwap>
99 const std::ostream &Write(std::ostream &os)
const
101 uint32_t copy = ValueLength;
102 #ifndef GDCM_WRITE_ODD_LENGTH
110 TSwap::SwapArray(©,1);
111 return os.write((
char*)(©),
sizeof(uint32_t));
114 template <
typename TSwap>
115 const std::ostream &Write16(std::ostream &os)
const
117 assert( ValueLength <= 65535 );
118 uint16_t copy = ValueLength;
119 #ifndef GDCM_WRITE_ODD_LENGTH
127 TSwap::SwapArray(©,1);
128 return os.write((
char*)(©),
sizeof(uint16_t));
132 uint32_t ValueLength;
137 os << val.ValueLength;