@@ -51,21 +51,21 @@ public final class ByteArray implements Comparable<ByteArray>, JsonStringSeriali
51
51
52
52
@ NonNull private final byte [] bytes ;
53
53
54
- @ NonNull private final String base64 ;
54
+ @ NonNull private final String base64url ;
55
55
56
56
/** Create a new instance by copying the contents of <code>bytes</code>. */
57
57
public ByteArray (@ NonNull byte [] bytes ) {
58
58
this .bytes = BinaryUtil .copy (bytes );
59
- this .base64 = BASE64URL_ENCODER .encodeToString (this .bytes );
59
+ this .base64url = BASE64URL_ENCODER .encodeToString (this .bytes );
60
60
}
61
61
62
- private ByteArray (String base64 ) throws Base64UrlException {
62
+ private ByteArray (String base64url ) throws Base64UrlException {
63
63
try {
64
- this .bytes = BASE64URL_DECODER .decode (base64 );
64
+ this .bytes = BASE64URL_DECODER .decode (base64url );
65
65
} catch (IllegalArgumentException e ) {
66
- throw new Base64UrlException ("Invalid Base64Url encoding: " + base64 , e );
66
+ throw new Base64UrlException ("Invalid Base64Url encoding: " + base64url , e );
67
67
}
68
- this .base64 = base64 ;
68
+ this .base64url = base64url ;
69
69
}
70
70
71
71
/** Create a new instance by decoding <code>base64</code> as classic Base64 data. */
@@ -74,13 +74,13 @@ public static ByteArray fromBase64(@NonNull final String base64) {
74
74
}
75
75
76
76
/**
77
- * Create a new instance by decoding <code>base64 </code> as Base64Url data.
77
+ * Create a new instance by decoding <code>base64url </code> as Base64Url data.
78
78
*
79
- * @throws Base64UrlException if <code>base64 </code> is not valid Base64Url data.
79
+ * @throws Base64UrlException if <code>base64url </code> is not valid Base64Url data.
80
80
*/
81
81
@ JsonCreator
82
- public static ByteArray fromBase64Url (@ NonNull final String base64 ) throws Base64UrlException {
83
- return new ByteArray (base64 .split ("=" )[0 ]);
82
+ public static ByteArray fromBase64Url (@ NonNull final String base64url ) throws Base64UrlException {
83
+ return new ByteArray (base64url .split ("=" )[0 ]);
84
84
}
85
85
86
86
/**
@@ -124,7 +124,7 @@ public String getBase64() {
124
124
125
125
/** @return the content bytes encoded as Base64Url data, without padding. */
126
126
public String getBase64Url () {
127
- return base64 ;
127
+ return base64url ;
128
128
}
129
129
130
130
/** @return the content bytes encoded as hexadecimal data. */
@@ -136,7 +136,7 @@ public String getHex() {
136
136
/** Used by JSON serializer. */
137
137
@ Override
138
138
public String toJsonString () {
139
- return base64 ;
139
+ return base64url ;
140
140
}
141
141
142
142
@ Override
0 commit comments