Class UTFUtils


  • public class UTFUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      UTFUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String convertFromUTF8​(byte[] buf, int offset, int utfSize)  
      static java.lang.String convertUTF8WithBuf​(byte[] buf, char[] out, int offset, int utfSize)  
      static int countUTFBytes​(java.lang.String str)  
      static java.lang.String decodeUTF​(int utfSize, java.io.DataInput in)  
      static int writeShortToBuffer​(int val, byte[] buffer, int offset)  
      static int writeUTFBytesToBuffer​(java.lang.String str, byte[] buffer, int offset)  
      • Methods inherited from class java.lang.Object

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

      • UTFUtils

        public UTFUtils()
    • Method Detail

      • decodeUTF

        public static java.lang.String decodeUTF​(int utfSize,
                                                 java.io.DataInput in)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • convertFromUTF8

        public static java.lang.String convertFromUTF8​(byte[] buf,
                                                       int offset,
                                                       int utfSize)
                                                throws java.io.UTFDataFormatException
        Throws:
        java.io.UTFDataFormatException
      • convertUTF8WithBuf

        public static java.lang.String convertUTF8WithBuf​(byte[] buf,
                                                          char[] out,
                                                          int offset,
                                                          int utfSize)
                                                   throws java.io.UTFDataFormatException
        Throws:
        java.io.UTFDataFormatException
      • countUTFBytes

        public static int countUTFBytes​(java.lang.String str)
      • writeShortToBuffer

        public static int writeShortToBuffer​(int val,
                                             byte[] buffer,
                                             int offset)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • writeUTFBytesToBuffer

        public static int writeUTFBytesToBuffer​(java.lang.String str,
                                                byte[] buffer,
                                                int offset)
                                         throws java.io.IOException
        Throws:
        java.io.IOException