Class StringEncoding


  • public final class StringEncoding
    extends java.lang.Object
    Author:
    Matthias Broecheler (me@matthiasb.com)
    • Constructor Summary

      Constructors 
      Constructor Description
      StringEncoding()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String decode​(byte[] bytes)  
      static java.lang.String decode​(byte[] bytes, int offset, int length)  
      static byte[] decodeBase64​(java.lang.String value)  
      static byte[] encode​(java.lang.String value)  
      static java.lang.String encodeBase64​(byte[] bytes)  
      static java.lang.String format​(byte[] bytes)  
      static int getAsciiByteLength​(java.lang.String value)  
      static java.lang.String readAsciiString​(byte[] array, int offset)  
      static java.lang.String sha256​(java.lang.String string)  
      static java.util.UUID uuid​(java.lang.String value)  
      static int writeAsciiString​(byte[] array, int offset, java.lang.String value)
      Similar to StringSerializer
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringEncoding

        public StringEncoding()
    • Method Detail

      • writeAsciiString

        public static int writeAsciiString​(byte[] array,
                                           int offset,
                                           java.lang.String value)
        Similar to StringSerializer
      • readAsciiString

        public static java.lang.String readAsciiString​(byte[] array,
                                                       int offset)
      • getAsciiByteLength

        public static int getAsciiByteLength​(java.lang.String value)
      • encode

        public static byte[] encode​(java.lang.String value)
      • decode

        public static java.lang.String decode​(byte[] bytes)
      • decode

        public static java.lang.String decode​(byte[] bytes,
                                              int offset,
                                              int length)
      • encodeBase64

        public static java.lang.String encodeBase64​(byte[] bytes)
      • decodeBase64

        public static byte[] decodeBase64​(java.lang.String value)
      • sha256

        public static java.lang.String sha256​(java.lang.String string)
      • format

        public static java.lang.String format​(byte[] bytes)
      • uuid

        public static java.util.UUID uuid​(java.lang.String value)