Internal implementation of byte data trace.

@param source
@param sourceClass
@param data
@param start
@param count
165131
private void internalBytes(Object source, Class sourceClass, byte[] data, int start, int count)
    {
        StringBuffer stringBuffer = new StringBuffer();

        stringBuffer.append(sourceClass.getName());
        stringBuffer.append(" [");

        if (source != null)
        {
            stringBuffer.append(source);
        }
        else
        {
            stringBuffer.append("Static");
        }

        stringBuffer.append("]");
        stringBuffer.append(ls);

        if (data != null)
        {
            if (count > 0)
            {
                stringBuffer.append(formatBytes(data, start, count, true));
            }
            else
            {
                stringBuffer.append(formatBytes(data, start, data.length, true));
            }
        }
        else
        {
            stringBuffer.append("data is null");
        }

        Tr.debug(traceComponent, stringBuffer.toString());

        if (usePrintWriterForTrace)
        {
            if (printWriter != null)
            {
                printWriter.print(new java.util.Date()+" B ");
                printWriter.println(stringBuffer.toString());
                printWriter.flush();
            }
        }
    }
746240
public FutureData<DataSiftResult> start(final FutureData<ManagedSource> source) {
        if (source == null) {
            throw new IllegalArgumentException("A data source is required");
        }
        final FutureData<DataSiftResult> future = new FutureData<>();
        final DataSiftResult res = new BaseDataSiftResult();
        unwrapFuture(source, future, res, new FutureResponse<ManagedSource>() {
            public void apply(ManagedSource data) {
                URI uri = newParams().forURL(config.newAPIEndpointURI(START));
                POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, data, config)))
                        .form("id", data.getId());
                performRequest(future, request);
            }
        });
        return future;
    }
1040687
public void getBytes(byte cs[], int start) {
        System.arraycopy(getByteArray(), getByteOffset(), cs, start, getByteLength());
    }
1208175
public void readBytes (byte[] bytes, int offset, int count) throws KryoException {
		if (bytes == null) throw new IllegalArgumentException("bytes cannot be null.");
		int copyCount = Math.min(limit - position, count);
		while (true) {
			System.arraycopy(buffer, position, bytes, offset, copyCount);
			position += copyCount;
			count -= copyCount;
			if (count == 0) break;
			offset += copyCount;
			copyCount = Math.min(count, capacity);
			require(copyCount);
		}
	}
74222
private final void internalInfo(Object source, Class sourceClass, String methodName, String messageIdentifier, Object object)
    {
        if (usePrintWriterForTrace)
        {
            if (printWriter != null)
            {
                StringBuffer stringBuffer = new StringBuffer(new java.util.Date().toString());

                stringBuffer.append(" I ");
                stringBuffer.append(sourceClass.getName());
                stringBuffer.append(".");
                stringBuffer.append(methodName);


                printWriter.println(stringBuffer.toString());
                printWriter.println("\t\t"+NLS.format(messageIdentifier, object));
                printWriter.flush();
            }
        }

        if (object != null)
        {
            Tr.info(traceComponent, messageIdentifier, object);
        }
        else
        {
            Tr.info(traceComponent, messageIdentifier);
        }
    }
134513
public void logp(Level level, String sourceClass, String sourceMethod,
		String msg, Object params[]) 
	{
			//PK86423 Start
			//int lastParam = params.length-1;
			//if(params.length>0 && params[lastParam] instanceof Throwable){
			//	params[lastParam]=throwableToString((Throwable) params[lastParam]);
			//}
			if(params!=null && params.length>0 && params[params.length-1] instanceof Throwable){
				params[params.length-1]=throwableToString((Throwable) params[params.length-1]);
			}
			//PK86423 End
			delegateLogger.logp(level,sourceClass,sourceMethod,msg,params);
	}
868064
@Override
  public void write(byte[] b, int start, int length) throws IOException {
    currentDataSegmentBuffer.write(b, start, length);
    flushIfNeeded();
  }
706235
static public int byteIndexOf(byte[] bytes, byte target, int start_index) {

        int rc = -1; // simulate String.indexOf rc
        // stop when we are out of data or hit the target byte
        for (int index = start_index; index < bytes.length; index++) {
            if (target == bytes[index]) {
                rc = index;
                break;
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "byteIndexOf returning [" + rc + "]");
        }
        return rc;
    }
1174979
public void addExperiment(byte[] source) throws IOException {
        AceExperiment experiment = new AceExperiment(source);
        String eid = experiment.getId();
        if(this.experimentMap.containsKey("eid")) {
            LOG.error("Duplicate data found for experiment: {}", experiment.getValueOr("exname", ""));
        } else {
            this.experimentMap.put(eid, experiment);
        }
        this.eidMap.put(experiment.getValueOr("exname", ""), eid);
    }
862842
protected void init(Source source) throws SQLException {

        if (source == null) {
            throw Util.nullArgument("source");
        }

        Transformer           transformer =
            JDBCSQLXML.getIdentityTransformer();
        StreamResult          result      = new StreamResult();
        ByteArrayOutputStream baos        = new ByteArrayOutputStream();
        GZIPOutputStream      gzos;

        try {
            gzos = new GZIPOutputStream(baos);
        } catch (IOException ex) {
            throw Exceptions.transformFailed(ex);
        }
        result.setOutputStream(gzos);

        try {
            transformer.transform(source, result);
        } catch (TransformerException ex) {
            throw Exceptions.transformFailed(ex);
        }

        try {
            gzos.close();
        } catch (IOException ex) {
            throw Exceptions.transformFailed(ex);
        }

        byte[] data = baos.toByteArray();

        setGZipData(data);
        setReadable(true);
        setWritable(false);
    }
922449
public void write(byte[] data) {
        for(int i=0;i<data.length;i++) {
            writeByte(data[i]);
        }
    }
283535
@Override
	public <E> E parse(byte[] source, Class<E> objectClazz) {
		try (ParserWrapper parserWrapper = createParser(source)) {
			E result = mapperFor(objectClazz).parse(this, parserWrapper);
			return result;
		} catch (Exception e) {
			e.printStackTrace();
			throw new KriptonRuntimeException(e);
		}
	}
298244
public static Trace getTrace(Class sourceClass, String traceGroup) 
  {
    Class traceFactoryClass;
    Object ret = null;
    try 
    {
      traceFactoryClass = Class.forName("com.ibm.ws.sib.matchspace.utils.TraceFactory");

      Class[] params = new Class[]{Class.class, String.class};
      Method getTraceMethod = traceFactoryClass.getMethod("getTrace", params);
      Object[] objParams = new Object[]{sourceClass, traceGroup};
      ret = getTraceMethod.invoke(null, objParams);
    } 
    catch (Exception e) 
    {
      // No FFDC Code Needed.
      // Trace and FFDC not available so print to stdout.      
      e.printStackTrace();
    }    
       
    return (Trace)ret;
  }
692748
public static void copyArray(Object source, Object dest, int count) {
        System.arraycopy(source, 0, dest, 0, count);
    }
1355409
public void writeBytes (Object from, long offset, int count) throws KryoException {
		int copyCount = Math.min(capacity - position, count);
		while (true) {
			unsafe.copyMemory(from, offset, buffer, byteArrayBaseOffset + position, copyCount);
			position += copyCount;
			count -= copyCount;
			if (count == 0) break;
			offset += copyCount;
			copyCount = Math.min(capacity, count);
			require(copyCount);
		}
	}
608634
public void setData(byte[] bytes, byte[] sourceMap) {
		this.sourceMap = sourceMap;
		sourceMapSize = sourceMap != null ? sourceMap.length : 0;
		setBytes(bytes);
	}
542393
protected void initDataSource() {
    if (dataSource == null) {
      if (dataSourceJndiName != null) {
        try {
          dataSource = (DataSource) new InitialContext().lookup(dataSourceJndiName);
        } catch (Exception e) {
          throw new ProcessEngineException("couldn't lookup datasource from " + dataSourceJndiName + ": " + e.getMessage(), e);
        }

      } else if (jdbcUrl != null) {
        if ((jdbcDriver == null) || (jdbcUrl == null) || (jdbcUsername == null)) {
          throw new ProcessEngineException("DataSource or JDBC properties have to be specified in a process engine configuration");
        }

        PooledDataSource pooledDataSource =
            new PooledDataSource(ReflectUtil.getClassLoader(), jdbcDriver, jdbcUrl, jdbcUsername, jdbcPassword);

        if (jdbcMaxActiveConnections > 0) {
          pooledDataSource.setPoolMaximumActiveConnections(jdbcMaxActiveConnections);
        }
        if (jdbcMaxIdleConnections > 0) {
          pooledDataSource.setPoolMaximumIdleConnections(jdbcMaxIdleConnections);
        }
        if (jdbcMaxCheckoutTime > 0) {
          pooledDataSource.setPoolMaximumCheckoutTime(jdbcMaxCheckoutTime);
        }
        if (jdbcMaxWaitTime > 0) {
          pooledDataSource.setPoolTimeToWait(jdbcMaxWaitTime);
        }
        if (jdbcPingEnabled == true) {
          pooledDataSource.setPoolPingEnabled(true);
          if (jdbcPingQuery != null) {
            pooledDataSource.setPoolPingQuery(jdbcPingQuery);
          }
          pooledDataSource.setPoolPingConnectionsNotUsedFor(jdbcPingConnectionNotUsedFor);
        }
        dataSource = pooledDataSource;
      }

      if (dataSource instanceof PooledDataSource) {
        // ACT-233: connection pool of Ibatis is not properely initialized if this is not called!
        ((PooledDataSource) dataSource).forceCloseAll();
      }
    }

    if (databaseType == null) {
      initDatabaseType();
    }
  }