Changeset 174 for CoolStreaming
- Timestamp:
- Feb 23, 2011, 8:57:12 AM (14 years ago)
- Location:
- CoolStreaming
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolStreaming/Demo/VarBlockSerializer/UMainForm.lfm
r173 r174 14 14 Top = 8 15 15 Width = 632 16 ActivePage = TabSheet2 17 TabIndex = 1 16 ActivePage = TabSheet1 17 Anchors = [akTop, akLeft, akRight, akBottom] 18 TabIndex = 0 18 19 TabOrder = 0 19 20 object TabSheet1: TTabSheet -
CoolStreaming/Demo/VarBlockSerializer/VarBlockSerializerDemo.lpi
r173 r174 59 59 <EditorIndex Value="0"/> 60 60 <WindowIndex Value="0"/> 61 <TopLine Value=" 294"/>62 <CursorPos X=" 25" Y="296"/>61 <TopLine Value="167"/> 62 <CursorPos X="40" Y="174"/> 63 63 <UsageCount Value="55"/> 64 64 <Loaded Value="True"/> … … 80 80 <EditorIndex Value="2"/> 81 81 <WindowIndex Value="0"/> 82 <TopLine Value=" 753"/>83 <CursorPos X=" 54" Y="764"/>82 <TopLine Value="392"/> 83 <CursorPos X="74" Y="405"/> 84 84 <UsageCount Value="28"/> 85 85 <Loaded Value="True"/> … … 99 99 <WindowIndex Value="0"/> 100 100 <TopLine Value="134"/> 101 <CursorPos X="2 3" Y="151"/>101 <CursorPos X="26" Y="144"/> 102 102 <UsageCount Value="28"/> 103 103 <Loaded Value="True"/> … … 125 125 <JumpHistory Count="29" HistoryIndex="28"> 126 126 <Position1> 127 <Filename Value=" ..\..\UVarBlockSerializer.pas"/>128 <Caret Line=" 778" Column="1" TopLine="765"/>127 <Filename Value="UMainForm.pas"/> 128 <Caret Line="177" Column="1" TopLine="167"/> 129 129 </Position1> 130 130 <Position2> 131 131 <Filename Value="..\..\UVarBlockSerializer.pas"/> 132 <Caret Line=" 766" Column="1" TopLine="761"/>132 <Caret Line="302" Column="1" TopLine="289"/> 133 133 </Position2> 134 134 <Position3> 135 135 <Filename Value="..\..\UVarBlockSerializer.pas"/> 136 <Caret Line=" 767" Column="1" TopLine="761"/>136 <Caret Line="303" Column="1" TopLine="289"/> 137 137 </Position3> 138 138 <Position4> 139 139 <Filename Value="..\..\UVarBlockSerializer.pas"/> 140 <Caret Line=" 768" Column="1" TopLine="761"/>140 <Caret Line="304" Column="1" TopLine="289"/> 141 141 </Position4> 142 142 <Position5> 143 143 <Filename Value="..\..\UVarBlockSerializer.pas"/> 144 <Caret Line=" 769" Column="1" TopLine="761"/>144 <Caret Line="305" Column="1" TopLine="289"/> 145 145 </Position5> 146 146 <Position6> 147 147 <Filename Value="..\..\UVarBlockSerializer.pas"/> 148 <Caret Line=" 770" Column="1" TopLine="761"/>148 <Caret Line="226" Column="1" TopLine="213"/> 149 149 </Position6> 150 150 <Position7> 151 <Filename Value=" UMainForm.pas"/>152 <Caret Line=" 111" Column="41" TopLine="108"/>151 <Filename Value="..\..\UVarBlockSerializer.pas"/> 152 <Caret Line="370" Column="1" TopLine="357"/> 153 153 </Position7> 154 154 <Position8> 155 <Filename Value=" UMainForm.pas"/>156 <Caret Line=" 126" Column="28" TopLine="108"/>155 <Filename Value="..\..\UVarBlockSerializer.pas"/> 156 <Caret Line="371" Column="1" TopLine="357"/> 157 157 </Position8> 158 158 <Position9> 159 159 <Filename Value="..\..\UVarBlockSerializer.pas"/> 160 <Caret Line=" 810" Column="16" TopLine="802"/>160 <Caret Line="372" Column="1" TopLine="357"/> 161 161 </Position9> 162 162 <Position10> 163 163 <Filename Value="..\..\UVarBlockSerializer.pas"/> 164 <Caret Line=" 766" Column="1" TopLine="760"/>164 <Caret Line="374" Column="1" TopLine="357"/> 165 165 </Position10> 166 166 <Position11> 167 167 <Filename Value="..\..\UVarBlockSerializer.pas"/> 168 <Caret Line=" 767" Column="1" TopLine="760"/>168 <Caret Line="375" Column="1" TopLine="357"/> 169 169 </Position11> 170 170 <Position12> 171 171 <Filename Value="..\..\UVarBlockSerializer.pas"/> 172 <Caret Line=" 768" Column="1" TopLine="760"/>172 <Caret Line="385" Column="1" TopLine="372"/> 173 173 </Position12> 174 174 <Position13> 175 175 <Filename Value="..\..\UVarBlockSerializer.pas"/> 176 <Caret Line=" 769" Column="1" TopLine="760"/>176 <Caret Line="386" Column="1" TopLine="372"/> 177 177 </Position13> 178 178 <Position14> 179 179 <Filename Value="..\..\UVarBlockSerializer.pas"/> 180 <Caret Line=" 770" Column="1" TopLine="760"/>180 <Caret Line="387" Column="1" TopLine="372"/> 181 181 </Position14> 182 182 <Position15> 183 183 <Filename Value="..\..\UVarBlockSerializer.pas"/> 184 <Caret Line=" 771" Column="1" TopLine="760"/>184 <Caret Line="388" Column="1" TopLine="372"/> 185 185 </Position15> 186 186 <Position16> 187 <Filename Value=" UMainForm.pas"/>188 <Caret Line=" 126" Column="28" TopLine="108"/>187 <Filename Value="..\..\UVarBlockSerializer.pas"/> 188 <Caret Line="390" Column="1" TopLine="375"/> 189 189 </Position16> 190 190 <Position17> 191 <Filename Value=" UMainForm.pas"/>192 <Caret Line=" 113" Column="1" TopLine="108"/>191 <Filename Value="..\..\UVarBlockSerializer.pas"/> 192 <Caret Line="392" Column="1" TopLine="375"/> 193 193 </Position17> 194 194 <Position18> 195 <Filename Value=" UMainForm.pas"/>196 <Caret Line=" 114" Column="1" TopLine="108"/>195 <Filename Value="..\..\UVarBlockSerializer.pas"/> 196 <Caret Line="393" Column="1" TopLine="375"/> 197 197 </Position18> 198 198 <Position19> 199 <Filename Value=" UMainForm.pas"/>200 <Caret Line=" 115" Column="1" TopLine="108"/>199 <Filename Value="..\..\UVarBlockSerializer.pas"/> 200 <Caret Line="394" Column="1" TopLine="375"/> 201 201 </Position19> 202 202 <Position20> 203 <Filename Value=" UMainForm.pas"/>204 <Caret Line=" 114" Column="13" TopLine="108"/>203 <Filename Value="..\..\UVarBlockSerializer.pas"/> 204 <Caret Line="395" Column="1" TopLine="375"/> 205 205 </Position20> 206 206 <Position21> 207 <Filename Value=" UMainForm.pas"/>208 <Caret Line="3 26" Column="3" TopLine="309"/>207 <Filename Value="..\..\UVarBlockSerializer.pas"/> 208 <Caret Line="396" Column="1" TopLine="375"/> 209 209 </Position21> 210 210 <Position22> 211 <Filename Value=" UMainForm.pas"/>212 <Caret Line=" 113" Column="1" TopLine="100"/>211 <Filename Value="..\..\UVarBlockSerializer.pas"/> 212 <Caret Line="402" Column="1" TopLine="389"/> 213 213 </Position22> 214 214 <Position23> 215 <Filename Value=" UMainForm.pas"/>216 <Caret Line=" 321" Column="1" TopLine="308"/>215 <Filename Value="..\..\UVarBlockSerializer.pas"/> 216 <Caret Line="403" Column="18" TopLine="389"/> 217 217 </Position23> 218 218 <Position24> 219 <Filename Value=" UMainForm.pas"/>220 <Caret Line=" 322" Column="1" TopLine="308"/>219 <Filename Value="..\..\UVarBlockSerializer.pas"/> 220 <Caret Line="405" Column="22" TopLine="389"/> 221 221 </Position24> 222 222 <Position25> 223 <Filename Value=" UMainForm.pas"/>224 <Caret Line=" 323" Column="1" TopLine="308"/>223 <Filename Value="..\..\UVarBlockSerializer.pas"/> 224 <Caret Line="403" Column="29" TopLine="389"/> 225 225 </Position25> 226 226 <Position26> 227 <Filename Value=" UMainForm.pas"/>228 <Caret Line=" 324" Column="1" TopLine="308"/>227 <Filename Value="..\..\UVarBlockSerializer.pas"/> 228 <Caret Line="108" Column="29" TopLine="97"/> 229 229 </Position26> 230 230 <Position27> 231 <Filename Value=" UMainForm.pas"/>232 <Caret Line=" 330" Column="68" TopLine="309"/>231 <Filename Value="..\..\UVarBlockSerializer.pas"/> 232 <Caret Line="404" Column="17" TopLine="392"/> 233 233 </Position27> 234 234 <Position28> 235 235 <Filename Value="UMainForm.pas"/> 236 <Caret Line="1 13" Column="1" TopLine="100"/>236 <Caret Line="172" Column="1" TopLine="167"/> 237 237 </Position28> 238 238 <Position29> 239 <Filename Value=" UMainForm.pas"/>240 <Caret Line=" 114" Column="1" TopLine="101"/>239 <Filename Value="..\..\UVarBlockSerializer.pas"/> 240 <Caret Line="405" Column="74" TopLine="392"/> 241 241 </Position29> 242 242 </JumpHistory> … … 264 264 </CompilerOptions> 265 265 <Debugging> 266 <BreakPoints Count="1"> 267 <Item1> 268 <Source Value="UMainForm.pas"/> 269 <Line Value="172"/> 270 </Item1> 271 </BreakPoints> 266 272 <Exceptions Count="3"> 267 273 <Item1> -
CoolStreaming/UVarBlockSerializer.pas
r173 r174 106 106 SMaskedValueReadError = 'Error reading masked variable length block.'; 107 107 SUInt64Overflow = '64-bit UInt read overflow.'; 108 SReadError = 'Stream read error. Expected length %d, read %d. Source stream size %d.'; 108 109 109 110 { TVarBlockSerializer } … … 365 366 Data: Byte; 366 367 Length: Cardinal; 367 I: Cardinal;368 RealLength: Cardinal; 368 369 LengthMask: Byte; 369 370 begin 370 371 AStream.Size := 0; 371 I := 0;372 372 Length := 1; 373 373 … … 400 400 401 401 // If CopyFrom parameter count is zero then whole source is copied 402 if Length > 1 then 403 AStream.CopyFrom(Stream, Length - 1); 402 if Length > 1 then begin 403 RealLength := AStream.CopyFrom(Stream, Length - 1); 404 if RealLength < (Length - 1) then 405 raise EReadError.Create(Format(SReadError, [Length - 1, RealLength, Stream.Size])); 406 end; 404 407 AStream.Position := 0; 405 408 end; … … 413 416 Result := 1; // Byte block length 414 417 Data := Stream.ReadByte; 415 if Data = $ff then Result := ReadVarUInt + 2418 if Data = $ff then Result := GetVarSize + ReadVarUInt + 1 416 419 else begin 417 420 Result := DecodeUnaryLength(Data);
Note:
See TracChangeset
for help on using the changeset viewer.