If you don't put pass "new ArraySink" to decoder, .MaxRetrivable() will tell you how many bytes you can retrieve from decoder by calling Get(). When you do pass the ArraySink in, decoder writes its output to the ArraySink, so you can't get output from it by calling Get(). Instead you should call TotalPutLength() on the ArraySink object.
-------------------------------------------------- From: "Jerry Ignius" <[email protected]> Sent: Sunday, January 18, 2009 3:33 AM To: "Crypto++ Users" <[email protected]> Subject: Length of Base64 Decoded Content > > Hi all. > I'd like to know how to get the size of Base64 decoded content. I've > tried the following (variables have been renamed): > > Base64Decoder decoder(new ArraySink(byte_array, length)); > decoder.Put(reinterpret_cast<const byte*>(string.c_str()), > string.length()); > decoder.MessageEnd(); > > I've tried calling .TotalBytesRetrievable() and .MaxRetrivable() > before and after .MessageEnd(), and checking the return value of .Put > (), all of which return zero. However, if I assume the length of the > decoded content to be 64, which it is, I can access the decoded > content fine (it is a base64 encoded RSA signature, which validates > when I assume 64 bytes in length). > I would very much appreciate any help anyone could offer here. > > Thank you, Jerry. > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. -~----------~----~----~----~------~----~------~--~---
