net.snowflake.client.jdbc

## Class JsonResultChunk

- java.lang.Object
- - net.snowflake.client.jdbc.SnowflakeResultChunk
  - - net.snowflake.client.jdbc.JsonResultChunk

    public class JsonResultChunk
    extends SnowflakeResultChunk

### Nested Class Summary

### Nested classes/interfaces inherited from class net.snowflake.client.jdbc.SnowflakeResultChunk

`SnowflakeResultChunk.DownloadState`

### Constructor Summary

Constructors
Constructor and Description
`JsonResultChunk(String url, int rowCount, int colCount, int uncompressedSize)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `addByte(byte b, int pos)`
`void` `addBytes(byte[] src, int offset, int pos, int length)`
`void` `addOffset(int offset)`
`void` `addRow(Object[] row)`
`int` `computeCharactersNeeded()`
`long` `computeNeededChunkMemory()` Compute the memory necessary to store the data of this chunk
`void` `ensureRowsComplete()` Checks that all data has been added after parsing.
`static Object` `extractCell(com.fasterxml.jackson.databind.JsonNode resultData, int rowIdx, int colIdx)`
`void` `freeData()` Free the data stored in this chunk.
`byte` `get(int offset)`
`Object` `getCell(int rowIdx, int colIdx)` Creates a String object for the given cell
`void` `nextIndex()`
`void` `reset()` Reset all data structure used in this result chunk
`void` `setIsNull()`
`void` `setLastLength(int len)`
`void` `tryReuse(net.snowflake.client.jdbc.JsonResultChunk.ResultChunkDataCache cache)`

### Methods inherited from class net.snowflake.client.jdbc.SnowflakeResultChunk

`getColCount, getDownloadCondition, getDownloadError, getDownloadState, getDownloadTime, getLock, getParseTime, getRowCount, getScrubbedUrl, getUncompressedSize, getUrl, isReleased, setDownloadError, setDownloadState, setDownloadTime, setParseTime, setReleased`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JsonResultChunk

    public JsonResultChunk(String url,
                           int rowCount,
                           int colCount,
                           int uncompressedSize)

### Method Detail

#### extractCell

    public static Object extractCell(com.fasterxml.jackson.databind.JsonNode resultData,
                                     int rowIdx,
                                     int colIdx)

#### tryReuse

    public void tryReuse(net.snowflake.client.jdbc.JsonResultChunk.ResultChunkDataCache cache)

#### getCell

    public final Object getCell(int rowIdx,
                                int colIdx)

Creates a String object for the given cell

Parameters:
  `rowIdx` - zero based row
  `colIdx` - zero based column
Returns:
  String

#### addRow

    public final void addRow(Object[] row)
                      throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`

#### ensureRowsComplete

    public final void ensureRowsComplete()
                                  throws SnowflakeSQLException

Checks that all data has been added after parsing.

Throws:
  `SnowflakeSQLException` - when rows are not all downloaded

#### reset

    public void reset()

Description copied from class: `SnowflakeResultChunk`
Reset all data structure used in this result chunk

#### computeNeededChunkMemory

    public final long computeNeededChunkMemory()

Compute the memory necessary to store the data of this chunk

Returns:
  necessary memory in bytes

#### freeData

    public final void freeData()

Description copied from class: `SnowflakeResultChunk`
Free the data stored in this chunk. Called when finish consuming the chunk

#### computeCharactersNeeded

    public int computeCharactersNeeded()

#### addOffset

    public void addOffset(int offset)
                   throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`

#### setIsNull

    public void setIsNull()
                   throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`

#### setLastLength

    public void setLastLength(int len)
                       throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`

#### nextIndex

    public void nextIndex()
                   throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`

#### get

    public byte get(int offset)
             throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`

#### addByte

    public void addByte(byte b,
                        int pos)
                 throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`

#### addBytes

    public void addBytes(byte[] src,
                         int offset,
                         int pos,
                         int length)
                  throws SnowflakeSQLException

Throws:
  `SnowflakeSQLException`