internal/coding/base64.go
func (bc *Base64Cleaner) Read(p []byte) (n int, err error) {
	// Size our buf to smallest of len(p) or len(bc.buffer).
	size := len(bc.buffer)
	if size > len(p) {
		size = len(p)
	}
	buf := bc.buffer[:size]
	bn, err := bc.r.Read(buf)
	for i := 0; i < bn; i++ {
		switch base64CleanerTable[buf[i]&0x7f] {
		case -2:
			// Strip these silently: tab, \n, \r, space, equals sign.
		case -1:
			// Strip these, but warn the client.
			bc.Errors = append(bc.Errors, fmt.Errorf("Unexpected %q in Base64 stream", buf[i]))
		default:
			p[n] = buf[i]
			n++
		}
	}
	return
}
func (bc *Base64Cleaner) Read(p []byte) (n int, err error) {
	// Size our buf to smallest of len(p) or len(bc.buffer).
	size := len(bc.buffer)
	if size > len(p) {
		size = len(p)
	}
	buf := bc.buffer[:size]
	bn, err := bc.r.Read(buf)
	for i := 0; i < bn; i++ {
		switch base64CleanerTable[buf[i]&0x7f] {
		case -2:
			// Strip these silently: tab, \n, \r, space, equals sign.
		case -1:
			// Strip these, but warn the client.
			bc.Errors = append(bc.Errors, fmt.Errorf("Unexpected %q in Base64 stream", buf[i]))
		default:
			p[n] = buf[i]
			n++
		}
	}
	return
}
// Read method for io.Reader interface.