Click here to Skip to main content
15,914,406 members
Home / Discussions / C#
   

C#

 
QuestionRe: Checking if a INT is NaN Pin
leppie13-Dec-05 0:55
leppie13-Dec-05 0:55 
AnswerRe: Checking if a INT is NaN Pin
binglin13-Dec-05 13:44
binglin13-Dec-05 13:44 
AnswerRe: Checking if a INT is NaN Pin
Robert Rohde13-Dec-05 1:08
Robert Rohde13-Dec-05 1:08 
GeneralRe: Checking if a INT is NaN Pin
binglin13-Dec-05 13:46
binglin13-Dec-05 13:46 
GeneralRe: Checking if a INT is NaN Pin
Member 1512503031-May-21 5:51
Member 1512503031-May-21 5:51 
QuestionBinaryWriter.Write(string) Pin
Daniel Monzert13-Dec-05 0:05
Daniel Monzert13-Dec-05 0:05 
AnswerRe: BinaryWriter.Write(string) Pin
Ista13-Dec-05 2:33
Ista13-Dec-05 2:33 
AnswerRe: BinaryWriter.Write(string) Pin
Daniel Grunwald13-Dec-05 4:15
Daniel Grunwald13-Dec-05 4:15 
You could use the underlying stream's position property to find the length.
Normally you would just use BinaryReader.ReadString to read the value, I don't know why you need the exact format. I suppose that the value of the first byte determines how many bytes are used for the length - a first byte of 0 to 127 means just one byte, 128 to x means 2 bytes etc... just a guess.
MSDN does not seem to explain this, so the easiest way would be to look at the implementation (use Reflector or look at the Rotor or Mono code)...

OK, I've looked at it myself, here's the code (Rotor):
389: protected void Write7BitEncodedInt(int value) {
390: // Write out an int 7 bits at a time. The high bit of the byte,
391: // when on, tells reader to continue reading more bytes.
392: uint v = (uint) value; // support negative numbers
393: while (value >= 0x80) {
394: Write((byte) (value | 0x80));
395: value >>= 7;
396: }
397: Write((byte)value);
398: }
GeneralRe: BinaryWriter.Write(string) Pin
Daniel Monzert14-Dec-05 6:33
Daniel Monzert14-Dec-05 6:33 
GeneralRe: BinaryWriter.Write(string) Pin
Daniel Grunwald14-Dec-05 6:40
Daniel Grunwald14-Dec-05 6:40 
QuestionPerfMon: Where are my counters? Pin
Salil Khedkar12-Dec-05 23:50
Salil Khedkar12-Dec-05 23:50 
AnswerRe: PerfMon: Where are my counters? Pin
S. Senthil Kumar13-Dec-05 1:06
S. Senthil Kumar13-Dec-05 1:06 
GeneralRe: PerfMon: Where are my counters? Pin
Salil Khedkar13-Dec-05 20:06
Salil Khedkar13-Dec-05 20:06 
QuestionC# And ADO.NET N-Tier Help Pin
systemnyc12-Dec-05 23:15
systemnyc12-Dec-05 23:15 
AnswerRe: C# And ADO.NET N-Tier Help Pin
Ista13-Dec-05 2:37
Ista13-Dec-05 2:37 
GeneralRe: C# And ADO.NET N-Tier Help Pin
systemnyc13-Dec-05 18:26
systemnyc13-Dec-05 18:26 
GeneralRe: C# And ADO.NET N-Tier Help Pin
Ista14-Dec-05 10:01
Ista14-Dec-05 10:01 
GeneralRe: C# And ADO.NET N-Tier Help Pin
systemnyc14-Dec-05 17:23
systemnyc14-Dec-05 17:23 
Questionusing Authorization Manager and principal permission Pin
keinan12-Dec-05 23:06
keinan12-Dec-05 23:06 
Questionhow to configure log4net for class library project Pin
YogeshChoudhary12-Dec-05 23:03
YogeshChoudhary12-Dec-05 23:03 
AnswerRe: how to configure log4net for class library project Pin
Anthony_Yio13-Dec-05 0:26
Anthony_Yio13-Dec-05 0:26 
GeneralRe: how to configure log4net for class library project Pin
YogeshChoudhary13-Dec-05 0:46
YogeshChoudhary13-Dec-05 0:46 
QuestionCrystal Reprt Pin
albCode12-Dec-05 22:56
albCode12-Dec-05 22:56 
AnswerRe: Crystal Reprt Pin
Polis Pilavas12-Dec-05 23:04
Polis Pilavas12-Dec-05 23:04 
Questionapplication pool getting recycled Pin
savage_12-Dec-05 22:49
savage_12-Dec-05 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.