Base64 Encoding With JDK 1.6+ And Java 8 : Adam Bien's Weblog

Base64 Encoding With JDK 1.6+ And Java 8 : Adam Bien's Weblog Adam Bien's Weblog « The Cost Of An "Empt... | Main | LightFish v1.2.0... » Base64 Encoding With JDK 1.6+ And Java 8 The method: javax.xml.bind.DatatypeConverter#printBase64Binary(byte[]) encodes a byte[] into a Base64 encoded string. To encode a String with JDK 1.6+ use the static method printBase64Binary: String encodedDuke = DatatypeConverter.printBase64Binary("duke".getBytes("UTF-8")); Java 8 comes with the java.util.Base64 class entirely dedicated to Basic, URL, Filenames and MIMEs encoding and decoding. See you at Java EE Workshops at MUC Airport ! Posted at 07:14AM Aug 24, 2013 by Adam Bien , Comments[5]  | Views/Hits: 13759 NEW workshop: HTML 5 and JavaScript Essentials , Three days in April 2017: from Java EE 7 Architectures over Microservices to Performance, Troubleshooting and Monitoring On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming. Newsletter: airhacks.news A book about rethinking Java EE Patterns Comments: It's time for Java 8 and JEE 7 :-) Posted by gustav on August 24, 2013 at 02:58 PM CEST # Hello Adam, thank you. Few days ago before your post i removed Bouncy Castle provider from project which was used for converting data to base64 and back. Also DatatypeConverter class contains many helpful methods not only for base64 coding/encoding. Posted by Vitaliy Kalayda on August 25, 2013 at 01:49 AM CEST # the link http://download.java.net/jdk8/docs/api/java/util/Base64.html is dead! Posted by Hossein on March 25, 2015 at 07:10 PM CET # I'm not a developer, i always use the free online base64 string converter(http://www.online-code.net/base64-string.html) to encode and decode base64. Posted by JonyGreen on September 23, 2015 at 04:51 AM CEST # Great Link, Here some usefull web site to base64 encode http://ebase64encode.org/ Posted by avi g on October 12, 2015 at 03:25 PM CEST # Post a Comment: Name: E-Mail: URL: Notify me by email of new comments Remember Information? Your Comment: HTML Syntax: NOT allowed Number of posts: 1594 Number of comments: 5869 Yesterday's hits: 25314 Today's hits: 2164 Post reads / hour: 831 Top posts: Java 8 FlatMap Example : Adam Bien's Weblog 91023 Java 8: Reading A File Into A String : Adam Bien's Weblog 54901 Delving into JSF Scaffolding with JPA on Netbeans 6.1 : Adam Bien's Weblog 46732 Java 7+: Writing A String To File--A One Liner : Adam Bien's Weblog 36469 Reading InputStream Into String With Java 8 : Adam Bien's Weblog 31265 Java 8: From Ordinary For-Loop To An IntStream : Adam Bien's Weblog 24593 Building Perfect Anti-Facades - Almost Without Layers, For Better Maintaina[...] 23670 JAX-RS: Returning A List Of Instances, Problem and Solution : Adam Bien's W[...] 21584 Adam Bien (Comments) 19117 Trending (last hour): Toshiba Notebooks With OpenSolaris - The Java Workstation? : Adam Bien's Weblog 5 Useful Maven Repository Viewer In NetBeans : Adam Bien's Weblog 5 Simplest Possible JSF 2 / EJB 3.1 / JPA Component - With WAR Deployment : A[...] 4 Slideless Microservices From Oredev : Adam Bien's Weblog 3 Is JavaFX Ready For The Enterprise? or Why Should You Care (11 questions an[...] 3 about.adam-bien.com blog archives realworldpatterns.com Real World Java EE Patterns Rethinking Best Practices Order from amazon.de Order from amazon.com Online Workshops ...the last 150 posts GlassFish on Steroids, Micro, Full, Clouds and Commercial Support--An Interview With Dominika Tasarz Load Balancing Microservices With Docker, nginx and TomEE Accidental Spring Evangelism, Rolling Updates, Log Management, Exception Factories, Docker, Queuing Choices or 33rd airhacks.tv Java EE 8 News, Central Logs, Layering, Util, ExceptionFactories, JDBC in Docker, DTOs, Lombok--Or 33rd airhacks.tv TomEE 7.0.2 Full--Docker Smoke Test Slicing The Monolith--With Java EE And Docker HTTP Status Code Test Service: statustest Custom Matchers, Better Messages: JAX-RS Client Rulz v0.0.4 released New Java EE Related Docker Images Arrived: Docklands Adding And Substracting Path Instances With Java How Many "Util"(-ities) Classes Ship With Java 8? Class Naming: Suffix "Util" Is Evil Slideless Microservices From Oredev Unwrapping Exceptions With ApplicationException Microservices Simplify Exception Handling in JAX-RS Serializing POJOs With Custom Content-Type In JAX-RS 2.x MessageFormat as Built-In Template Engine JVM, RAM, Docker, Configuration and JNDI, gRPC, ORMs, Load Balancers or 32nd airhacks.tv gRPC, Appservers, Docker, ORMs, Security, Transparent Proxies or Questions for the 32nd airhacks.tv Payara Micro And Docker Speed Comparison: yarns vs. npm "High Performance Java EE" from HighLoad Conf Upcoming (some free) JUGs, Online Streaming Sessions And Workshops IMWorld Session: Building "Mobile First" Applications With The Killer Microservice Platform Java 8 CompletableFuture Example Implementing Health Checks With Docker News: Java EE 8/9, JavaOne, Gateways, Service Registries, API D