0

So I implement a base64 decoder and while encoding (BIO_write() on BIO_f_base64) you should BIO_flush() as they say in documentation. However, they don't mention anything regarding BIO_read() (decoding). Should I flush after BIO_read() and if not what are the consequences if I do?

Maxim Chetrusca
  • 3,262
  • 1
  • 32
  • 28

1 Answers1

3

You don't need to. BIO_flush tells the writer that there's no more data coming, so it can write the equals signs at the end to pad out the result, if necessary. You don't need this when reading.

Ewan Mellor
  • 6,747
  • 1
  • 24
  • 39