List of usage examples for org.apache.commons.codec.binary Base64 encodeBase64Chunked
public static byte[] encodeBase64Chunked(final byte[] binaryData)
From source file:pt.lsts.neptus.util.ByteUtil.java
public static void main(String[] args) { dumpAsHex("Teste", "Isto de facto \0 um teste para ver se imprime bem Hex!".getBytes(), System.out); dumpAsHex(FileUtil.getFileAsString("LICENSE.md").getBytes(), System.out); String fxImg = FileUtil.getResourceAsFileKeepName("images/auto-pilot.png"); dumpAsHex(FileUtil.getFileAsString(fxImg).getBytes(), System.out); String tt = "\0\1Isto de facto um teste para ver se imprime bem Hex!"; tt = FileUtil.getFileAsString("LICENSE.md"); System.out.println(new String(Base64.encodeBase64Chunked(tt.getBytes()))); //dumpAsHex(tt.getBytes(), System.out); System.out.println(new String(Base64.decodeBase64(Base64.encodeBase64Chunked(tt.getBytes())))); System.err.println(dumpAsHexToString(FileUtil.getFileAsString("LICENSE.md").getBytes())); }
From source file:pt.up.fe.dceg.neptus.util.ByteUtil.java
public static void main(String[] args) { dumpAsHex("Teste", "Isto de facto \0 um teste para ver se imprime bem Hex!".getBytes(), System.out); dumpAsHex(FileUtil.getFileAsString("legal/Neptus-LICENSE.txt").getBytes(), System.out); dumpAsHex(FileUtil.getFileAsString("src/images/auto-pilot.png").getBytes(), System.out); String tt = "\0\1Isto de facto um teste para ver se imprime bem Hex!"; tt = FileUtil.getFileAsString("legal/Neptus-LICENSE.txt"); NeptusLog.pub().info("<###> " + new String(Base64.encodeBase64Chunked(tt.getBytes()))); //dumpAsHex(tt.getBytes(), System.out); NeptusLog.pub().info("<###> " + new String(Base64.decodeBase64(Base64.encodeBase64Chunked(tt.getBytes())))); System.err.println(dumpAsHexToString(FileUtil.getFileAsString("legal/Neptus-LICENSE.txt").getBytes())); }
From source file:uk.chromis.pos.util.Base64Encoder.java
/** * * @param raw//from w w w . ja v a 2 s . c om * @return */ public static String encodeChunked(byte[] raw) { try { return new String(Base64.encodeBase64Chunked(raw), "ASCII"); } catch (UnsupportedEncodingException e) { return null; } }