Package com.alibaba.fastjson2.util
Class IOUtils
java.lang.Object
com.alibaba.fastjson2.util.IOUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int[]static final long[]static final longstatic final short[]static final int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic intconvEndian(boolean big, int n) static longconvEndian(boolean big, long n) static intdecodeUTF8(byte[] src, int off, int len, byte[] dst) static intdecodeUTF8(byte[] src, int off, int len, char[] dst) static intdigit(int d) static intdigit1(byte[] bytes, int off) static intdigit1(char[] chars, int off) static intdigit2(byte[] bytes, int off) static intdigit2(char[] chars, int off) static intdigit3(byte[] bytes, int off) static intdigit3(char[] chars, int off) static intdigit4(byte[] bytes, int off) static intdigit4(char[] chars, int off) 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 bytegetByte(byte[] str, int pos) static chargetChar(byte[] str, int pos) static chargetChar(char[] buf, int pos) 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 intgetIntBE(byte[] bytes, int offset) static intgetIntLE(byte[] bytes, int offset) static intgetIntLE(char[] bytes, int offset) static intgetIntUnaligned(byte[] bytes, int offset) static intgetIntUnaligned(char[] bytes, int offset) static longgetLongBE(byte[] bytes, int offset) static longgetLongLE(byte[] bytes, int offset) static longgetLongLE(char[] bytes, int offset) static longgetLongUnaligned(byte[] bytes, int offset) static longgetLongUnaligned(char[] bytes, int offset) static shortgetShortBE(byte[] bytes, int offset) static shortgetShortLE(byte[] bytes, int offset) static shortgetShortUnaligned(byte[] bytes, int offset) static shorthex2(int i) static shorthex2U(int i) static inthex4U(int i) static inthexDigit4(byte[] bytes, int offset) static inthexDigit4(char[] bytes, int offset) static intindexOfChar(byte[] value, int ch, int fromIndex, int max) static intindexOfChar(char[] value, int ch, int fromIndex, int max) static intindexOfDoubleQuote(byte[] value, int fromIndex, int max) static intindexOfDoubleQuoteV(byte[] value, int fromIndex, int max) static intindexOfLineSeparator(byte[] value, int fromIndex, int max) static intindexOfLineSeparatorV(byte[] value, int fromIndex, int max) static intindexOfQuote(byte[] value, int quote, int fromIndex, int max) static intindexOfQuoteV(byte[] value, int quote, int fromIndex, int max) static intindexOfSlash(byte[] value, int fromIndex, int max) static intindexOfSlashV(byte[] value, int fromIndex, int max) static booleanisALSE(byte[] buf, int pos) static booleanisALSE(char[] buf, int pos) static booleanisASCII(byte[] bytes) static booleanisASCII(byte[] bytes, int off, int len) static booleanstatic booleanisDigit(int ch) static booleanisDigit2(byte[] bytes, int off) static booleanisDigit2(char[] bytes, int off) static booleanisLatin1(char[] chars, int off, int len) static booleanisNonSlashASCII(byte[] bytes, int off, int len) static booleanisNULL(byte[] buf, int pos) static booleanisNULL(char[] buf, int pos) static booleanisNumber(byte[] chars, int off, int len) static booleanisNumber(char[] chars, int off, int len) static booleanstatic booleanisTRUE(byte[] buf, int pos) static booleanisTRUE(char[] buf, int pos) static booleanisUTF8BOM(byte[] bytes, int off) static longstatic longlines(InputStream in) static booleannotALSE(byte[] buf, int pos) static booleannotALSE(char[] buf, int pos) static booleannotNULL(byte[] buf, int pos) static booleannotNULL(char[] buf, int pos) static booleannotTRUE(byte[] buf, int pos) static booleannotTRUE(char[] buf, int pos) static intparseInt(byte[] bytes, int off, int len) static intputBoolean(byte[] bytes, int off, boolean v) static intputBoolean(char[] chars, int off, boolean v) static voidputIntBE(byte[] buf, int pos, int v) static voidputIntLE(byte[] buf, int pos, int v) static voidputIntLE(char[] buf, int pos, int v) static voidputIntUnaligned(byte[] buf, int pos, int v) static voidputIntUnaligned(char[] buf, int pos, int v) static voidputLongBE(byte[] buf, int pos, long v) static voidputLongLE(byte[] buf, int pos, long v) static voidputLongLE(char[] buf, int pos, long v) static voidputLongUnaligned(byte[] buf, int pos, long v) static voidputLongUnaligned(char[] buf, int pos, long v) static voidputNULL(byte[] buf, int pos) static voidputNULL(char[] buf, int pos) static voidputShortBE(byte[] buf, int pos, short v) static voidputShortLE(byte[] buf, int pos, short v) static voidputShortUnaligned(byte[] buf, int pos, short v) static intstringSize(int x) static intstringSize(long x) static intutf16Hex2(int i) static longutf16Hex4U(long i) static intwriteDecimal(byte[] buf, int off, long unscaledVal, int scale) static intwriteDecimal(char[] buf, int off, long unscaledVal, int scale) static voidwriteDigitPair(byte[] buf, int charPos, int value) static voidwriteDigitPair(char[] buf, int charPos, int value) static intwriteInt16(byte[] buf, int pos, short value) static intwriteInt16(char[] buf, int pos, short value) static intwriteInt32(byte[] buf, int off, long val) static intwriteInt32(char[] buf, int off, long val) static intwriteInt64(byte[] buf, int off, long val) static intwriteInt64(char[] buf, int off, long val) 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 Details
-
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
-
-
Constructor Details
-
IOUtils
public IOUtils()
-
-
Method Details
-
writeDigitPair
public static void writeDigitPair(byte[] buf, int charPos, int value) -
writeDigitPair
public static void writeDigitPair(char[] buf, int charPos, int value) -
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
-
isNumber
public static boolean isNumber(char[] chars, int off, int len) -
isNumber
public static boolean isNumber(byte[] chars, int off, int len) -
close
-
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
- Throws:
Exception
-
lines
- 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
-
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
-
writeInt64
public static int writeInt64(byte[] buf, int off, long val) -
writeInt64
public static int writeInt64(char[] buf, int off, long val) -
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 off, long val) -
writeInt32
public static int writeInt32(char[] buf, int off, long val) -
getByte
public static byte getByte(byte[] str, int pos) -
getChar
public static char getChar(char[] buf, int pos) -
getChar
public static char getChar(byte[] str, int pos) -
putShortBE
public static void putShortBE(byte[] buf, int pos, short v) -
putShortLE
public static void putShortLE(byte[] buf, int pos, short v) -
putIntBE
public static void putIntBE(byte[] buf, int pos, int v) -
putIntLE
public static void putIntLE(byte[] buf, int pos, int v) -
putIntLE
public static void putIntLE(char[] buf, int pos, int v) -
putShortUnaligned
public static void putShortUnaligned(byte[] buf, int pos, short v) -
putIntUnaligned
public static void putIntUnaligned(char[] buf, int pos, int v) -
putIntUnaligned
public static void putIntUnaligned(byte[] buf, int pos, int v) -
putLongLE
public static void putLongLE(char[] buf, int pos, long v) -
putLongUnaligned
public static void putLongUnaligned(char[] buf, int pos, long v) -
putLongUnaligned
public static void putLongUnaligned(byte[] buf, int pos, long v) -
putLongBE
public static void putLongBE(byte[] buf, int pos, long v) -
putLongLE
public static void putLongLE(byte[] buf, int pos, long v) -
putBoolean
public static int putBoolean(byte[] bytes, int off, boolean v) -
putBoolean
public static int putBoolean(char[] chars, int off, boolean v) -
isALSE
public static boolean isALSE(byte[] buf, int pos) -
notALSE
public static boolean notALSE(byte[] buf, int pos) -
isALSE
public static boolean isALSE(char[] buf, int pos) -
notALSE
public static boolean notALSE(char[] buf, int pos) -
isNULL
public static boolean isNULL(byte[] buf, int pos) -
notNULL
public static boolean notNULL(byte[] buf, int pos) -
isTRUE
public static boolean isTRUE(byte[] buf, int pos) -
notTRUE
public static boolean notTRUE(byte[] buf, int pos) -
isTRUE
public static boolean isTRUE(char[] buf, int pos) -
notTRUE
public static boolean notTRUE(char[] buf, int pos) -
isNULL
public static boolean isNULL(char[] buf, int pos) -
notNULL
public static boolean notNULL(char[] buf, int pos) -
putNULL
public static void putNULL(byte[] buf, int pos) -
putNULL
public static void putNULL(char[] buf, int pos) -
digit4
public static int digit4(char[] chars, int off) -
digit4
public static int digit4(byte[] bytes, int off) -
digit3
public static int digit3(char[] chars, int off) -
digit3
public static int digit3(byte[] bytes, int off) -
digit2
public static int digit2(char[] chars, int off) -
digit2
public static int digit2(byte[] bytes, int off) -
isDigit2
public static boolean isDigit2(byte[] bytes, int off) -
isDigit2
public static boolean isDigit2(char[] bytes, int off) -
digit
public static int digit(int d) -
digit1
public static int digit1(char[] chars, int off) -
digit1
public static int digit1(byte[] bytes, int off) -
indexOfQuote
public static int indexOfQuote(byte[] value, int quote, int fromIndex, int max) -
indexOfQuoteV
public static int indexOfQuoteV(byte[] value, int quote, int fromIndex, int max) -
indexOfDoubleQuote
public static int indexOfDoubleQuote(byte[] value, int fromIndex, int max) -
indexOfDoubleQuoteV
public static int indexOfDoubleQuoteV(byte[] value, int fromIndex, int max) -
indexOfLineSeparator
public static int indexOfLineSeparator(byte[] value, int fromIndex, int max) -
indexOfLineSeparatorV
public static int indexOfLineSeparatorV(byte[] value, int fromIndex, int max) -
indexOfSlash
public static int indexOfSlash(byte[] value, int fromIndex, int max) -
indexOfSlashV
public static int indexOfSlashV(byte[] value, int fromIndex, int max) -
indexOfChar
public static int indexOfChar(byte[] value, int ch, int fromIndex, int max) -
indexOfChar
public static int indexOfChar(char[] value, int ch, int fromIndex, int max) -
hexDigit4
public static int hexDigit4(byte[] bytes, int offset) -
hexDigit4
public static int hexDigit4(char[] bytes, int offset) -
isDigit
public static boolean isDigit(int ch) -
getShortUnaligned
public static short getShortUnaligned(byte[] bytes, int offset) -
getShortBE
public static short getShortBE(byte[] bytes, int offset) -
getShortLE
public static short getShortLE(byte[] bytes, int offset) -
isUTF8BOM
public static boolean isUTF8BOM(byte[] bytes, int off) -
getIntBE
public static int getIntBE(byte[] bytes, int offset) -
getIntLE
public static int getIntLE(byte[] bytes, int offset) -
getIntLE
public static int getIntLE(char[] bytes, int offset) -
getIntUnaligned
public static int getIntUnaligned(byte[] bytes, int offset) -
getIntUnaligned
public static int getIntUnaligned(char[] bytes, int offset) -
getLongBE
public static long getLongBE(byte[] bytes, int offset) -
getLongUnaligned
public static long getLongUnaligned(byte[] bytes, int offset) -
getLongUnaligned
public static long getLongUnaligned(char[] bytes, int offset) -
getLongLE
public static long getLongLE(byte[] bytes, int offset) -
getLongLE
public static long getLongLE(char[] bytes, int offset) -
hex2
public static short hex2(int i) -
hex2U
public static short hex2U(int i) -
utf16Hex2
public static int utf16Hex2(int i) -
hex4U
public static int hex4U(int i) -
utf16Hex4U
public static long utf16Hex4U(long i) -
convEndian
public static int convEndian(boolean big, int n) -
convEndian
public static long convEndian(boolean big, long n) -
isLatin1
public static boolean isLatin1(char[] chars, int off, int len) -
isASCII
-
isASCII
public static boolean isASCII(byte[] bytes) -
isASCII
public static boolean isASCII(byte[] bytes, int off, int len) -
isNonSlashASCII
public static boolean isNonSlashASCII(byte[] bytes, int off, int len) -
parseInt
public static int parseInt(byte[] bytes, int off, int len)
-