Package 

Class ProgressiveStringDecoder


  • 
    public class ProgressiveStringDecoder
    
                        

    Class to decode encoded strings from byte array chunks. As in different encodings single character could take up to 4 characters byte array passed to decode could have parts of the characters which can't be correctly decoded.

    This class is designed in assumption that original byte stream is correctly formatted string in given encoding. Otherwise some parts of the data won't be decoded.

    • Method Summary

      Modifier and Type Method Description
      String decodeNext(Array<byte> data, int length) Parses data to String If there is a partial multi-byte symbol on the edge of the String it getsaved to the reminder and added to the string on the decodeNext call.
      • Methods inherited from class java.lang.Object

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

      • ProgressiveStringDecoder

        ProgressiveStringDecoder(Charset charset)
        Parameters:
        charset - expected charset of the data
    • Method Detail

      • decodeNext

         String decodeNext(Array<byte> data, int length)

        Parses data to String If there is a partial multi-byte symbol on the edge of the String it getsaved to the reminder and added to the string on the decodeNext call.