Class CSVReader<T>
java.lang.Object
com.alibaba.fastjson2.stream.StreamReader<T>
com.alibaba.fastjson2.support.csv.CSVReader<T>
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class com.alibaba.fastjson2.stream.StreamReader
StreamReader.ColumnStat, StreamReader.Feature, StreamReader.StreamReaderSpliterator<T> -
Field Summary
FieldsFields inherited from class com.alibaba.fastjson2.stream.StreamReader
columns, columnStats, columnStatsMap, end, errorCount, features, fieldReaders, inputEnd, lineEnd, lineNextStart, lineSize, lineStart, lineTerminated, mapping, objectCreator, off, rowCount, SIZE_512K, typeReaders, types -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfig(StreamReader.Feature... features) voidconfig(StreamReader.Feature feature, boolean state) protected ObjectintgetColumn(int columnIndex) getColumnStat(int i) getColumnStat(String name) getColumnType(int columnIndex) abstract booleanisEnd()booleanstatic <T> CSVReader<T>static <T> CSVReader<T>of(byte[] utf8Bytes, int off, int len, Charset charset, ByteArrayValueConsumer consumer) static <T> CSVReader<T>static CSVReaderof(byte[] utf8Bytes, ByteArrayValueConsumer consumer) static <T> CSVReader<T>static CSVReaderstatic <T> CSVReader<T>static <T> CSVReader<T>of(char[] chars, int off, int len, CharArrayValueConsumer consumer) static <T> CSVReader<T>static <T> CSVReader<T>static CSVReaderstatic CSVReaderof(File file, ByteArrayValueConsumer consumer) static CSVReaderof(File file, CharArrayValueConsumer consumer) static <T> CSVReader<T>static CSVReaderstatic CSVReaderof(File file, Charset charset, ByteArrayValueConsumer consumer) static CSVReaderof(File file, Charset charset, CharArrayValueConsumer consumer) static <T> CSVReader<T>static CSVReaderstatic <T> CSVReader<T>of(InputStream in, Class<T> objectClass) static CSVReaderof(InputStream in, Type... types) static <T> CSVReader<T>of(InputStream in, Charset charset, Class<T> objectClass) static CSVReaderof(InputStream in, Charset charset, Type... types) static <T> CSVReader<T>static CSVReaderstatic <T> CSVReaderstatic CSVReaderabstract voidreadAll()abstract voidreadAll(int maxRows) final String[]readLine()abstract voidreadLineObjectAll(boolean readHeader, Consumer<T> consumer) voidreadLineObjectAll(Consumer<T> consumer) final Object[]protected abstract Object[]readLineValues(boolean strings) introwCount()static introwCount(byte[] bytes, StreamReader.Feature... features) static introwCount(char[] chars, StreamReader.Feature... features) static intstatic introwCount(InputStream in) static introwCount(String str, StreamReader.Feature... features) voidskipLines(int lines) abstract voidstatAll()abstract voidstatAll(int maxRows) Methods inherited from class com.alibaba.fastjson2.stream.StreamReader
seekLine, stream, stream
-
Field Details
-
objectClass
-
-
Constructor Details
-
CSVReader
-
-
Method Details
-
config
-
config
-
of
-
of
-
of
-
of
-
of
- Throws:
IOException
-
of
- Throws:
IOException
-
of
public static CSVReader of(File file, Charset charset, ByteArrayValueConsumer consumer) throws IOException - Throws:
IOException
-
of
- Throws:
IOException
-
of
public static CSVReader of(File file, Charset charset, CharArrayValueConsumer consumer) throws IOException - Throws:
IOException
-
of
- Throws:
IOException
-
of
- Throws:
IOException
-
of
public static <T> CSVReader<T> of(File file, Charset charset, Class<T> objectClass) throws IOException - Throws:
IOException
-
of
- Throws:
IOException
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
public static <T> CSVReader<T> of(byte[] utf8Bytes, int off, int len, Charset charset, ByteArrayValueConsumer consumer) -
of
-
of
-
of
-
of
-
skipLines
- Throws:
IOException
-
readHeader
-
getColumns
-
getColumn
-
getColumnType
-
getColumnStats
-
readLineObjectAll
-
readLineObjectAll
-
readLineObject
- Specified by:
readLineObjectin classStreamReader<T>
-
isEnd
public abstract boolean isEnd() -
readLineValues
-
readLineValues
-
readLine
-
rowCount
-
rowCount
-
rowCount
-
rowCount
- Throws:
IOException
-
rowCount
- Throws:
IOException
-
errorCount
public int errorCount() -
rowCount
public int rowCount() -
error
-
getColumnStat
-
getColumnStat
-
readLineAll
- Since:
- 2.0.30
-
readLineObjectAll
- Since:
- 2.0.30
-
isObjectSupport
public boolean isObjectSupport() -
statAll
public abstract void statAll() -
statAll
public abstract void statAll(int maxRows) -
readAll
public abstract void readAll() -
readAll
public abstract void readAll(int maxRows)
-