- if (leftOverSize != 0) {
- // Flush the previous encoded sequence.
- if ((posn + 2) > byteLength) {
+ if (isInShifted) {
+ if (leftOverSize != 0) {
+ // Flush the previous encoded sequence.
+ if ((posn + 1) > byteLength) {
+ throw new ArgumentException (_("Arg_InsufficientSpace"), "bytes");
+ }
+ bytes[posn++] = (byte)(base64 [leftOverBits << (6 - leftOverSize)]);
+ }
+ if ((posn + 1) > byteLength) {