Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
open for different alphabets
  • Loading branch information
cljk committed Jul 23, 2019
commit c44f596cdd942ec73011581b708d752c54fa1ec8
10 changes: 9 additions & 1 deletion src/main/java/org/apache/commons/codec/binary/Base64.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ public Base64(final int lineLength, final byte[] lineSeparator) {
* @since 1.4
*/
public Base64(final int lineLength, final byte[] lineSeparator, final boolean urlSafe) {
this(lineLength, lineSeparator, urlSafe ? URL_SAFE_ENCODE_TABLE : STANDARD_ENCODE_TABLE);
}

public Base64(byte[] encodeTable) {
this(0, CHUNK_SEPARATOR, encodeTable);
}

public Base64(final int lineLength, final byte[] lineSeparator, byte[] encodingTable) {
super(BYTES_PER_UNENCODED_BLOCK, BYTES_PER_ENCODED_BLOCK,
lineLength,
lineSeparator == null ? 0 : lineSeparator.length);
Expand All @@ -294,7 +302,7 @@ public Base64(final int lineLength, final byte[] lineSeparator, final boolean ur
this.lineSeparator = null;
}
this.decodeSize = this.encodeSize - 1;
this.encodeTable = urlSafe ? URL_SAFE_ENCODE_TABLE : STANDARD_ENCODE_TABLE;
this.encodeTable = encodingTable;
}

/**
Expand Down