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
Prev Previous commit
Next Next commit
open for different alphabets - add javadoc
  • Loading branch information
cljk committed Jul 23, 2019
commit 50aa3704a8bc025d249714a050ee733d82d4586d
22 changes: 20 additions & 2 deletions src/main/java/org/apache/commons/codec/binary/Base64.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,28 @@ public Base64(final int lineLength, final byte[] lineSeparator, final boolean ur
this(lineLength, lineSeparator, urlSafe ? URL_SAFE_ENCODE_TABLE : STANDARD_ENCODE_TABLE);
}

public Base64(byte[] encodeTable) {
this(0, CHUNK_SEPARATOR, encodeTable);
/**
* Creates a Base64 codec used for decoding and encoding with non-standard encodingTable-table
*
* @param encodingTable
* The manual encodeTable - a byte array of 64 chars
*/
public Base64(byte[] encodingTable) {
this(0, CHUNK_SEPARATOR, encodingTable);
}

/**
* Creates a Base64 codec used for decoding and encoding with non-standard encode-table and given lineLength and lineSeparator
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* 4). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @param lineSeparator
* Each line of encoded data will end with this sequence of bytes.
* @param encodingTable
* The manual encodeTable - a byte array of 64 chars
*/
public Base64(final int lineLength, final byte[] lineSeparator, byte[] encodingTable) {
super(BYTES_PER_UNENCODED_BLOCK, BYTES_PER_ENCODED_BLOCK,
lineLength,
Expand Down