Package com.swiftmq.tools.util
Class UTFUtils
- java.lang.Object
-
- com.swiftmq.tools.util.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)
-
-
-
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
-
-