public Object getInternalObject ( ColumnInformation columnInfo , TimeZone timeZone ) throws SQLException { if ( lastValueWasNull ( ) ) { return null ; } switch ( columnInfo . getColumnType ( ) ) { case BIT : if ( columnInfo . getLength ( ) == 1 ) { return buf [ pos ] != 0 ; } byte [ ] dataBit = new byte [ length ] ; System . arraycopy ( buf , pos , dataBit , 0 , length ) ; return dataBit ; case TINYINT : if ( options . tinyInt1isBit && columnInfo . getLength ( ) == 1 ) { return buf [ pos ] != 0 ; } return getInternalInt ( columnInfo ) ; case INTEGER : if ( ! columnInfo . isSigned ( ) ) { return getInternalLong ( columnInfo ) ; } return getInternalInt ( columnInfo ) ; case BIGINT : if ( ! columnInfo . isSigned ( ) ) { return getInternalBigInteger ( columnInfo ) ; } return getInternalLong ( columnInfo ) ; case DOUBLE : return getInternalDouble ( columnInfo ) ; case VARCHAR : case VARSTRING : case STRING : if ( columnInfo . isBinary ( ) ) { byte [ ] data = new byte [ getLengthMaxFieldSize ( ) ] ; System . arraycopy ( buf , pos , data , 0 , getLengthMaxFieldSize ( ) ) ; return data ; } return getInternalString ( columnInfo , null , timeZone ) ; case TIMESTAMP : case DATETIME : return getInternalTimestamp ( columnInfo , null , timeZone ) ; case DATE : return getInternalDate ( columnInfo , null , timeZone ) ; case DECIMAL : return getInternalBigDecimal ( columnInfo ) ; case BLOB : case LONGBLOB : case MEDIUMBLOB : case TINYBLOB : byte [ ] dataBlob = new byte [ getLengthMaxFieldSize ( ) ] ; System . arraycopy ( buf , pos , dataBlob , 0 , getLengthMaxFieldSize ( ) ) ; return dataBlob ; case NULL : return null ; case YEAR : if ( options . yearIsDateType ) { return getInternalDate ( columnInfo , null , timeZone ) ; } return getInternalShort ( columnInfo ) ; case SMALLINT : case MEDIUMINT : return getInternalInt ( columnInfo ) ; case FLOAT : return getInternalFloat ( columnInfo ) ; case TIME : return getInternalTime ( columnInfo , null , timeZone ) ; case OLDDECIMAL : case JSON : return getInternalString ( columnInfo , null , timeZone ) ; case GEOMETRY : byte [ ] data = new byte [ length ] ; System . arraycopy ( buf , pos , data , 0 , length ) ; return data ; case ENUM : break ; case NEWDATE : break ; case SET : break ; default : break ; } throw ExceptionMapper . getFeatureNotSupportedException ( "Type '" + columnInfo . getColumnType ( ) . getTypeName ( ) + "' is not supported" ) ; }
Get Object from raw binary format .