Class BinaryStringConverter


  • public class BinaryStringConverter
    extends java.lang.Object
    this class contains methods to convert binary data (a byte array) into a string and vice versa. Currently uses very simple conversion transferring every byte into 2 characters that describe the hex value of the byte. In order to improve performance we could use Base64, but this will need some more work as Android and the regular sun api cannot use the same Base64 encoders/decoders and we want to keep FatiMA code compatible to both platforms more info about conversion here: http://www.javaworld.com/javatips/jw-javatip117.html
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] decodeStringToBinary​(java.lang.String input)  
      static java.lang.String encodeBinaryToString​(byte[] input)  
      static void main​(java.lang.String[] args)
      test the conversion routines in a standalone program
      • Methods inherited from class java.lang.Object

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

      • BinaryStringConverter

        public BinaryStringConverter()
    • Method Detail

      • encodeBinaryToString

        public static java.lang.String encodeBinaryToString​(byte[] input)
      • decodeStringToBinary

        public static byte[] decodeStringToBinary​(java.lang.String input)
      • main

        public static void main​(java.lang.String[] args)
        test the conversion routines in a standalone program