Input: stringInput
Ouput: checksumValue
import com.wm.data.*;
import com.wm.util.Values;
import com.wm.app.b2b.server.Service;
import com.wm.app.b2b.server.ServiceException;
import java.util.zip.CRC32;
import java.util.zip.Checksum;
public final class CRC32_SVC
{
/**
* The primary method for the Java service
*
* @param pipeline
* The IData pipeline
* @throws ServiceException
*/
public static final void CRC32(IData pipeline) throws ServiceException {
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String stringInput = IDataUtil.getString( pipelineCursor, "stringInput" );
pipelineCursor.destroy();
byte bytes[] = stringInput.getBytes();
Checksum checksum = new CRC32();
checksum.update(bytes, 0, bytes.length);
long checksumValue = checksum.getValue();
// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_1, "checksumValue", checksumValue );
pipelineCursor_1.destroy();
}
// --- <<IS-BEGIN-SHARED-SOURCE-AREA>> ---
// --- <<IS-END-SHARED-SOURCE-AREA>> ---
}
Results:
stringInput: mahesh
checksumValue: 1443886754
Ouput: checksumValue
import com.wm.data.*;
import com.wm.util.Values;
import com.wm.app.b2b.server.Service;
import com.wm.app.b2b.server.ServiceException;
import java.util.zip.CRC32;
import java.util.zip.Checksum;
public final class CRC32_SVC
{
/**
* The primary method for the Java service
*
* @param pipeline
* The IData pipeline
* @throws ServiceException
*/
public static final void CRC32(IData pipeline) throws ServiceException {
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String stringInput = IDataUtil.getString( pipelineCursor, "stringInput" );
pipelineCursor.destroy();
byte bytes[] = stringInput.getBytes();
Checksum checksum = new CRC32();
checksum.update(bytes, 0, bytes.length);
long checksumValue = checksum.getValue();
// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_1, "checksumValue", checksumValue );
pipelineCursor_1.destroy();
}
// --- <<IS-BEGIN-SHARED-SOURCE-AREA>> ---
// --- <<IS-END-SHARED-SOURCE-AREA>> ---
}
Results:
stringInput: mahesh
checksumValue: 1443886754