public byte[] getBinary( int index, byte[] def ) throws KettleValueException { byte[] bin = rowMeta.getBinary( data, index ); if ( bin == null ) { return def; } return bin; }
private byte[] createCheckSum( Object[] r ) throws Exception { if ( meta.isOldChecksumBehaviour() ) { StringBuilder Buff = new StringBuilder(); // Loop through fields for ( int i = 0; i < data.fieldnr; i++ ) { Buff.append( getInputRowMeta().getValueMeta( data.fieldnrs[i] ).getNativeDataType( r[data.fieldnrs[i]] ) ); } // Updates the digest using the specified array of bytes data.digest.update( Buff.toString().getBytes() ); } else { ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Loop through fields for ( int i = 0; i < data.fieldnr; i++ ) { if ( getInputRowMeta().getValueMeta( data.fieldnrs[i] ).isBinary() ) { baos.write( getInputRowMeta().getBinary( r, data.fieldnrs[i] ) ); } else { baos.write( getInputRowMeta().getValueMeta( data.fieldnrs[i] ).getNativeDataType( r[data.fieldnrs[i]] ) .toString().getBytes() ); } } // Updates the digest using the specified array of bytes data.digest.update( baos.toByteArray() ); } // Completes the hash computation by performing final operations such as padding byte[] hash = data.digest.digest(); // After digest has been called, the MessageDigest object is reset to its initialized state return hash; }
baos.write( getInputRowMeta().getBinary( r, data.fieldnrs[i] ) ); } else { baos.write( getInputRowMeta().getValueMeta( data.fieldnrs[i] ).getNativeDataType( r[data.fieldnrs[i]] )
break; case ValueMetaInterface.TYPE_BINARY: byte[] byt = mi.getBinary( row, number ); output.print( "<startlob>" ); output.print( byt );
break; case ValueMetaInterface.TYPE_BINARY: byte[] byt = mi.getBinary( row, number ); outbuf.append( "<startlob>" );
byte[] byt = rowMetaInterface.getBinary( row, i );
break; case ValueMetaInterface.TYPE_BINARY: byte[] byt = mi.getBinary( row, number ); output.print( "<startlob>" ); output.print( byt );
value = getInputRowMeta().getBigNumber( r, index ); } else if ( clazz.equals( ( new byte[0] ).getClass() ) ) { value = getInputRowMeta().getBinary( r, index ); } else { value = getInputRowMeta().getValueMeta( index ).convertToNormalStorageType( r[index] );
public boolean isEmptyValue( String valueName ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } ValueMetaInterface metaType = rowMeta.getValueMeta( idx ); // find by source value type switch ( metaType.getType() ) { case ValueMetaInterface.TYPE_STRING: return rowMeta.getString( data, idx ) == null; case ValueMetaInterface.TYPE_BOOLEAN: return rowMeta.getBoolean( data, idx ) == null; case ValueMetaInterface.TYPE_INTEGER: return rowMeta.getInteger( data, idx ) == null; case ValueMetaInterface.TYPE_NUMBER: return rowMeta.getNumber( data, idx ) == null; case ValueMetaInterface.TYPE_BIGNUMBER: return rowMeta.getBigNumber( data, idx ) == null; case ValueMetaInterface.TYPE_BINARY: return rowMeta.getBinary( data, idx ) == null; case ValueMetaInterface.TYPE_DATE: case ValueMetaInterface.TYPE_TIMESTAMP: return rowMeta.getDate( data, idx ) == null; case ValueMetaInterface.TYPE_INET: return rowMeta.getString( data, idx ) == null; } throw new KettleValueException( "Unknown source type: " + metaType.getTypeDesc() ); }
if ( meta.isSecretKeyInField() ) { if ( meta.isReadKeyAsBinary() ) { realSecretKey = getInputRowMeta().getBinary( r, data.indexOfSecretkeyField ); if ( realSecretKey == null ) { throw new KettleStepException( BaseMessages.getString( byte[] encrBytes = data.Crypt.encrDecryptData( getInputRowMeta().getBinary( r, data.indexOfMessage ) );
inputStream = new ByteArrayInputStream( getInputRowMeta().getBinary( r, data.indexOfSourceFileFieldName ) );
.setInputStream( new ByteArrayInputStream( getInputRowMeta().getBinary( inputToStepRow, fieldIndex ) ) ); } else { throw new KettleException( "Unknown field location type" );