Skip to content

Commit bcfef89

Browse files
committed
JIRA: CODEC-89 new Base64().encode() appends a CRLF, and chunks results into 76 character lines
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@928107 13f79535-47bb-0310-9956-ffa450edef68
1 parent 38ba132 commit bcfef89

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/java/org/apache/commons/codec/binary/Base64.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,15 @@ public class Base64 implements BinaryEncoder, BinaryDecoder {
214214
/**
215215
* Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode.
216216
* <p>
217-
* When encoding the line length is 76, the line separator is CRLF, and the encoding table is STANDARD_ENCODE_TABLE.
217+
* When encoding the line length is 0 (no chunking), and the encoding table is STANDARD_ENCODE_TABLE.
218218
* </p>
219219
*
220220
* <p>
221221
* When decoding all variants are supported.
222222
* </p>
223223
*/
224224
public Base64() {
225-
this(false);
225+
this(0);
226226
}
227227

228228
/**

src/java/org/apache/commons/codec/binary/Base64InputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public Base64InputStream(InputStream in) {
7373
public Base64InputStream(InputStream in, boolean doEncode) {
7474
super(in);
7575
this.doEncode = doEncode;
76-
this.base64 = new Base64();
76+
this.base64 = new Base64(false);
7777
}
7878

7979
/**

src/java/org/apache/commons/codec/binary/Base64OutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public Base64OutputStream(OutputStream out) {
7272
public Base64OutputStream(OutputStream out, boolean doEncode) {
7373
super(out);
7474
this.doEncode = doEncode;
75-
this.base64 = new Base64();
75+
this.base64 = new Base64(false);
7676
}
7777

7878
/**

xdocs/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
</properties>
2424
<body>
2525
<release version="TBA" date="TBA" description="TBC">
26+
<action dev="sebb" type="fix" issue="CODEC-89">
27+
new Base64().encode() appends a CRLF, and chunks results into 76 character lines
28+
</action>
2629
<action dev="sebb" type="add" issue="CODEC-93" due-to="Julius Davies">
2730
Add test(s) to check that encodeBase64() does not chunk output.
2831
</action>

0 commit comments

Comments
 (0)