IME does not specify a fixed length for base64-encoded lines, but it does specify a maximum line length of 76 characters. Additionally it specifies that any extra-alphabetic characters must be ignored by a compliant decoder, although most implementations use a CR/LF newline pair to delimit encoded lines.
http://www.developer.com/java/other/article.php/3386271
But php's base64 didn't put a newlineAccording to RFC 1521, the output stream of encoded characters must be represented in lines of no more than 76 characters each.
Example of problem:
Jj4rK1k0TVLDnh1xnwOzum5JekxNY9L0y3JLahskxkmiQWgxc7pMeZARb8SpAEGuRMenb4rBd1Y2lOuTkvBkI8twHcC2FPFNhYJfWdk6PGPOFUr7ljH3gOSelX72neVPQSZyUoNoeQNn3x3ypWQ65dJmBwFAQBtQgam4BJtfvwE=
Java base64:
Jj4rK1k0TVLDnh1xnwOzum5JekxNY9L0y3JLahskxkmiQWgxc7pMeZARb8SpAEGuRMenb4rBd1Y2
lOuTkvBkI8twHcC2FPFNhYJfWdk6PGPOFUr7ljH3gOSelX72neVPQSZyUoNoeQNn3x3ypWQ65dJm
BwFAQBtQgam4BJtfvwE=
Please suggestion this is optional or required