Package com.alibaba.fastjson2.util
Class IOUtils
- java.lang.Object
-
- com.alibaba.fastjson2.util.IOUtils
-
public class IOUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intALSEstatic longALSE_64static int[]DIGITS_K_32static long[]DIGITS_K_64static longDOT_X0static intNULL_32static longNULL_64static short[]PACKED_DIGITSstatic int[]PACKED_DIGITS_UTF16static intTRUEstatic longTRUE_64
-
Constructor Summary
Constructors Constructor Description IOUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclose(Closeable x)static intdecodeUTF8(byte[] src, int off, int len, byte[] dst)static intdecodeUTF8(byte[] src, int off, int len, char[] dst)static intencodeUTF8(byte[] src, int offset, int len, byte[] dst, int dp)static intencodeUTF8(char[] src, int offset, int len, byte[] dst, int dp)static voidgetChars(int i, int index, byte[] buf)static voidgetChars(int i, int index, char[] buf)static voidgetChars(long i, int index, byte[] buf)static voidgetChars(long i, int index, char[] buf)static booleanisNumber(byte[] chars, int off, int len)static booleanisNumber(char[] chars, int off, int len)static booleanisNumber(String str)static longlines(File file)static longlines(InputStream in)static voidputInt(byte[] buf, int pos, int v)static voidputInt(char[] buf, int pos, int v)static voidputLong(char[] buf, int pos, long v)static voidputShort(byte[] buf, int pos, short v)static intstringSize(int x)static intstringSize(long x)static intwriteDecimal(byte[] buf, int off, long unscaledVal, int scale)static intwriteDecimal(char[] buf, int off, long unscaledVal, int scale)static intwriteInt16(byte[] buf, int pos, short value)static intwriteInt16(char[] buf, int pos, short value)static intwriteInt32(byte[] buf, int pos, int value)static intwriteInt32(char[] buf, int pos, int value)static intwriteInt64(byte[] buf, int pos, long value)static intwriteInt64(char[] buf, int pos, long value)static intwriteInt8(byte[] buf, int pos, byte value)static intwriteInt8(char[] buf, int pos, byte value)static intwriteLocalDate(byte[] bytes, int off, int year, int month, int dayOfMonth)static intwriteLocalDate(char[] chars, int off, int year, int month, int dayOfMonth)static voidwriteLocalTime(byte[] bytes, int off, int hour, int minute, int second)static intwriteLocalTime(byte[] bytes, int off, LocalTime time)static voidwriteLocalTime(char[] chars, int off, int hour, int minute, int second)static intwriteLocalTime(char[] chars, int off, LocalTime time)static intwriteNano(byte[] bytes, int off, int nano)static intwriteNano(char[] chars, int off, int nano)
-
-
-
Field Detail
-
NULL_32
public static final int NULL_32
-
NULL_64
public static final long NULL_64
-
TRUE
public static final int TRUE
-
TRUE_64
public static final long TRUE_64
-
ALSE
public static final int ALSE
-
ALSE_64
public static final long ALSE_64
-
DOT_X0
public static final long DOT_X0
-
DIGITS_K_32
public static final int[] DIGITS_K_32
-
DIGITS_K_64
public static final long[] DIGITS_K_64
-
PACKED_DIGITS
public static final short[] PACKED_DIGITS
-
PACKED_DIGITS_UTF16
public static final int[] PACKED_DIGITS_UTF16
-
-
Method Detail
-
stringSize
public static int stringSize(int x)
-
stringSize
public static int stringSize(long x)
-
getChars
public static void getChars(int i, int index, byte[] buf)
-
getChars
public static void getChars(int i, int index, char[] buf)
-
getChars
public static void getChars(long i, int index, byte[] buf)
-
getChars
public static void getChars(long i, int index, char[] buf)
-
writeDecimal
public static int writeDecimal(byte[] buf, int off, long unscaledVal, int scale)
-
writeDecimal
public static int writeDecimal(char[] buf, int off, long unscaledVal, int scale)
-
encodeUTF8
public static int encodeUTF8(byte[] src, int offset, int len, byte[] dst, int dp)
-
encodeUTF8
public static int encodeUTF8(char[] src, int offset, int len, byte[] dst, int dp)
-
isNumber
public static boolean isNumber(String str)
-
isNumber
public static boolean isNumber(char[] chars, int off, int len)
-
isNumber
public static boolean isNumber(byte[] chars, int off, int len)
-
close
public static void close(Closeable x)
-
decodeUTF8
public static int decodeUTF8(byte[] src, int off, int len, byte[] dst)
-
decodeUTF8
public static int decodeUTF8(byte[] src, int off, int len, char[] dst)
-
lines
public static long lines(InputStream in) throws Exception
- Throws:
Exception
-
writeLocalDate
public static int writeLocalDate(byte[] bytes, int off, int year, int month, int dayOfMonth)
-
writeLocalDate
public static int writeLocalDate(char[] chars, int off, int year, int month, int dayOfMonth)
-
writeLocalTime
public static void writeLocalTime(byte[] bytes, int off, int hour, int minute, int second)
-
writeLocalTime
public static int writeLocalTime(byte[] bytes, int off, LocalTime time)
-
writeNano
public static int writeNano(byte[] bytes, int off, int nano)
-
writeNano
public static int writeNano(char[] chars, int off, int nano)
-
writeLocalTime
public static void writeLocalTime(char[] chars, int off, int hour, int minute, int second)
-
writeLocalTime
public static int writeLocalTime(char[] chars, int off, LocalTime time)
-
writeInt64
public static int writeInt64(byte[] buf, int pos, long value)
-
writeInt64
public static int writeInt64(char[] buf, int pos, long value)
-
writeInt8
public static int writeInt8(byte[] buf, int pos, byte value)
-
writeInt8
public static int writeInt8(char[] buf, int pos, byte value)
-
writeInt16
public static int writeInt16(byte[] buf, int pos, short value)
-
writeInt16
public static int writeInt16(char[] buf, int pos, short value)
-
writeInt32
public static int writeInt32(byte[] buf, int pos, int value)
-
writeInt32
public static int writeInt32(char[] buf, int pos, int value)
-
putShort
public static void putShort(byte[] buf, int pos, short v)
-
putInt
public static void putInt(byte[] buf, int pos, int v)
-
putInt
public static void putInt(char[] buf, int pos, int v)
-
putLong
public static void putLong(char[] buf, int pos, long v)
-
-