|
31 | 31 | * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a> |
32 | 32 | * @author Apache Software Foundation |
33 | 33 | * @since 1.0-dev |
34 | | - * @version $Id: Base64.java,v 1.18 2004/03/18 17:34:56 ggregory Exp $ |
| 34 | + * @version $Id: Base64.java,v 1.19 2004/03/24 18:37:25 ggregory Exp $ |
35 | 35 | */ |
36 | 36 | public class Base64 implements BinaryEncoder, BinaryDecoder { |
37 | 37 |
|
38 | 38 | /** |
39 | | - * Chunk size according to RFC 2045. |
| 39 | + * Chunk size per RFC 2045 section 6.8. |
40 | 40 | * |
41 | 41 | * <p>The {@value} character limit does not count the trailing CRLF, but counts |
42 | 42 | * all other characters, including any equal signs.</p> |
43 | 43 | * |
44 | | - * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045 section 2.1</a> |
| 44 | + * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045 section 6.8</a> |
45 | 45 | */ |
46 | 46 | static final int CHUNK_SIZE = 76; |
47 | 47 |
|
48 | 48 | /** |
49 | | - * Chunk separator, we use a newline to separate chunks |
50 | | - * of encoded data (if you ask for it to be chunked). |
| 49 | + * Chunk separator per RFC 2045 section 2.1. |
| 50 | + * |
| 51 | + * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045 section 2.1</a> |
51 | 52 | */ |
52 | | - static final byte[] CHUNK_SEPARATOR = "\n".getBytes(); |
| 53 | + static final byte[] CHUNK_SEPARATOR = "\r\n".getBytes(); |
53 | 54 |
|
54 | 55 | /** |
55 | 56 | * The base length. |
@@ -167,8 +168,8 @@ public static boolean isArrayByteBase64(byte[] arrayOctect) { |
167 | 168 | } |
168 | 169 |
|
169 | 170 | /** |
170 | | - * Encodes binary data using the base64 algorithm (this |
171 | | - * does not "chunk" the output). |
| 171 | + * Encodes binary data using the base64 algorithm but |
| 172 | + * does not chunk the output. |
172 | 173 | * |
173 | 174 | * @param binaryData binary data to encode |
174 | 175 | * @return Base64 characters |
@@ -227,7 +228,8 @@ public byte[] decode(byte[] pArray) { |
227 | 228 | } |
228 | 229 |
|
229 | 230 | /** |
230 | | - * Encodes hex octects into Base64. |
| 231 | + * Encodes binary data using the base64 algorithm, optionally |
| 232 | + * chunking the output into 76 character blocks. |
231 | 233 | * |
232 | 234 | * @param binaryData Array containing binary data to encode. |
233 | 235 | * @param isChunked if isChunked is true this encoder will chunk |
|
0 commit comments