Skip to content

Commit

Permalink
StudentCard: Use Apache Commons codec for converting byte array to ba…
Browse files Browse the repository at this point in the history
…se64 string and viceversa
  • Loading branch information
leosarra committed Jul 24, 2019
1 parent a39b1ce commit 3171848
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package lithium.openstud.driver.core.models;

import org.apache.commons.codec.binary.Base64;
import org.threeten.bp.LocalDateTime;

import java.util.Base64;
import java.util.Objects;

public class StudentCard {
Expand Down Expand Up @@ -47,11 +47,11 @@ public void setIssueDate(LocalDateTime issueDate) {
}

public byte[] getImage() {
return Base64.getDecoder().decode(imageBase64);
return Base64.decodeBase64(imageBase64);
}

public void setImage(byte[] image) {
this.imageBase64 = Base64.getEncoder().encodeToString(image);
imageBase64 = Base64.encodeBase64String(image);
}

@Override
Expand Down

0 comments on commit 3171848

Please sign in to comment.