Skip to content

Commit 7f1a796

Browse files
committed
Port Base64OutputStream to non-deprecated methods
1 parent 4488b9d commit 7f1a796

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ static byte[] toIntegerBytes(final BigInteger bigInt) {
499499
return resizedBytes;
500500
}
501501

502-
private static byte[] toUrlSafeEncodeTable(final boolean urlSafe) {
502+
static byte[] toUrlSafeEncodeTable(final boolean urlSafe) {
503503
return urlSafe ? URL_SAFE_ENCODE_TABLE : STANDARD_ENCODE_TABLE;
504504
}
505505

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public Base64OutputStream(final OutputStream outputStream) {
8484
* true if we should encode all data written to us, false if we should decode.
8585
*/
8686
public Base64OutputStream(final OutputStream outputStream, final boolean doEncode) {
87-
super(outputStream, new Base64(false), doEncode);
87+
super(outputStream, Base64.builder().get(), doEncode);
8888
}
8989

9090
/**
@@ -104,7 +104,7 @@ public Base64OutputStream(final OutputStream outputStream, final boolean doEncod
104104
* If lineLength <= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
105105
*/
106106
public Base64OutputStream(final OutputStream outputStream, final boolean doEncode, final int lineLength, final byte[] lineSeparator) {
107-
super(outputStream, new Base64(lineLength, lineSeparator), doEncode);
107+
super(outputStream, Base64.builder().setLineLength(lineLength).setLineSeparator(lineSeparator).get(), doEncode);
108108
}
109109

110110
/**
@@ -126,7 +126,7 @@ public Base64OutputStream(final OutputStream outputStream, final boolean doEncod
126126
* @since 1.15
127127
*/
128128
public Base64OutputStream(final OutputStream outputStream, final boolean doEncode, final int lineLength, final byte[] lineSeparator,
129-
final CodecPolicy decodingPolicy) {
130-
super(outputStream, new Base64(lineLength, lineSeparator, false, decodingPolicy), doEncode);
129+
final CodecPolicy decodingPolicy) {
130+
super(outputStream, Base64.builder().setLineLength(lineLength).setLineSeparator(lineSeparator).setDecodingPolicy(decodingPolicy).get(), doEncode);
131131
}
132132
}

0 commit comments

Comments
 (0)