net\System\Net\mail\Base64Stream.cs (52)
137if (this.writeState != null && WriteState.Length > 0)
139switch (WriteState.Padding)
142WriteState.Append(base64EncodeMap[WriteState.LastBits], base64EncodeMap[64],
146WriteState.Append(base64EncodeMap[WriteState.LastBits], base64EncodeMap[64]);
149WriteState.Padding = 0;
224WriteState.AppendHeader();
226switch (WriteState.Padding)
229WriteState.Append(base64EncodeMap[WriteState.LastBits | ((buffer[cur]&0xf0)>>4)]);
232WriteState.LastBits = (byte)((buffer[cur]&0x0f)<<2);
233WriteState.Padding = 1;
237WriteState.Append(base64EncodeMap[((buffer[cur]&0x0f)<<2) | ((buffer[cur+1]&0xc0)>>6)]);
238WriteState.Append(base64EncodeMap[(buffer[cur+1]&0x3f)]);
241WriteState.Padding = 0;
244WriteState.Append(base64EncodeMap[WriteState.LastBits | ((buffer[cur]&0xc0)>>6)]);
245WriteState.Append(base64EncodeMap[(buffer[cur]&0x3f)]);
248WriteState.Padding = 0;
258&& (WriteState.CurrentLineLength + sizeOfBase64EncodedChar + writeState.FooterLength > lineLength))
260WriteState.AppendCRLF(shouldAppendSpaceToCRLF);
268WriteState.Append(base64EncodeMap[(buffer[cur]&0xfc)>>2]);
269WriteState.Append(base64EncodeMap[((buffer[cur]&0x03)<<4) | ((buffer[cur+1]&0xf0)>>4)]);
270WriteState.Append(base64EncodeMap[((buffer[cur+1]&0x0f)<<2) | ((buffer[cur+2]&0xc0)>>6)]);
271WriteState.Append(base64EncodeMap[(buffer[cur+2]&0x3f)]);
278&& (WriteState.CurrentLineLength + sizeOfBase64EncodedChar + writeState.FooterLength >= lineLength))
280WriteState.AppendCRLF(shouldAppendSpaceToCRLF);
288WriteState.Append(base64EncodeMap[(buffer[cur]&0xFC)>>2]);
289WriteState.Append(base64EncodeMap[((buffer[cur]&0x03)<<4)|((buffer[cur+1]&0xf0)>>4)]);
291WriteState.Append(base64EncodeMap[((buffer[cur+1]&0x0f)<<2)]);
292WriteState.Append(base64EncodeMap[64]);
293WriteState.Padding = 0;
296WriteState.LastBits = (byte)((buffer[cur+1]&0x0F)<<2);
297WriteState.Padding = 1;
303WriteState.Append(base64EncodeMap[(buffer[cur]&0xFC)>>2]);
305WriteState.Append(base64EncodeMap[(byte)((buffer[cur]&0x03)<<4)]);
306WriteState.Append(base64EncodeMap[64]);
307WriteState.Append(base64EncodeMap[64]);
308WriteState.Padding = 0;
311WriteState.LastBits = (byte)((buffer[cur]&0x03)<<4);
312WriteState.Padding = 2;
319WriteState.AppendFooter();
330return ASCIIEncoding.ASCII.GetString(this.WriteState.Buffer, 0, this.WriteState.Length);
352if (this.writeState != null && WriteState.Length > 0)
361base.Write(WriteState.Buffer, 0, WriteState.Length);
362WriteState.Reset();
527IAsyncResult result = this.parent.BaseStream.BeginWrite(this.parent.WriteState.Buffer, 0, this.parent.WriteState.Length, onWrite, this);
543this.parent.WriteState.Reset();