org.apache.gobblin.util.guid.Guid.fromByteArrays()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中org.apache.gobblin.util.guid.Guid.fromByteArrays()方法的一些代码示例,展示了Guid.fromByteArrays()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Guid.fromByteArrays()方法的具体详情如下:
包路径:org.apache.gobblin.util.guid.Guid
类名称:Guid
方法名:fromByteArrays

Guid.fromByteArrays介绍

[英]Generate a Guid for an array of byte arrays.
[中]为字节数组数组生成Guid。

代码示例

代码示例来源:origin: apache/incubator-gobblin

/**
 * Combine multiple {@link Guid}s into a single {@link Guid}.
 * @throws IOException
 */
public static Guid combine(Guid... guids) throws IOException {
 byte[][] byteArrays = new byte[guids.length][];
 for (int i = 0; i < guids.length; i++) {
  byteArrays[i] = guids[i].sha;
 }
 return fromByteArrays(byteArrays);
}

代码示例来源:origin: apache/incubator-gobblin

/**
 * Generate a {@link Guid} for an array of {@link HasGuid}.
 * @param objs array of {@link HasGuid}.
 * @return a single {@link Guid} for the array.
 * @throws IOException
 */
public static Guid fromHasGuid(HasGuid... objs) throws IOException {
 byte[][] byteArrays = new byte[objs.length][];
 for (int i = 0; i < objs.length; i++) {
  byteArrays[i] = objs[i].guid().sha;
 }
 return fromByteArrays(byteArrays);
}

代码示例来源:origin: apache/incubator-gobblin

/**
 * Creates a new {@link Guid} which is a unique, replicable representation of the pair (this, byteArrays).
 * @param byteArrays an array of byte arrays.
 * @return a new {@link Guid}.
 * @throws IOException
 */
public Guid append(byte[]... byteArrays) throws IOException {
 if (byteArrays == null || byteArrays.length == 0) {
  return this;
 }
 return fromByteArrays(ArrayUtils.add(byteArrays, this.sha));
}

代码示例来源:origin: org.apache.gobblin/gobblin-utility

/**
 * Combine multiple {@link Guid}s into a single {@link Guid}.
 * @throws IOException
 */
public static Guid combine(Guid... guids) throws IOException {
 byte[][] byteArrays = new byte[guids.length][];
 for (int i = 0; i < guids.length; i++) {
  byteArrays[i] = guids[i].sha;
 }
 return fromByteArrays(byteArrays);
}

代码示例来源:origin: org.apache.gobblin/gobblin-utility

/**
 * Creates a new {@link Guid} which is a unique, replicable representation of the pair (this, byteArrays).
 * @param byteArrays an array of byte arrays.
 * @return a new {@link Guid}.
 * @throws IOException
 */
public Guid append(byte[]... byteArrays) throws IOException {
 if (byteArrays == null || byteArrays.length == 0) {
  return this;
 }
 return fromByteArrays(ArrayUtils.add(byteArrays, this.sha));
}

代码示例来源:origin: org.apache.gobblin/gobblin-utility

/**
 * Generate a {@link Guid} for an array of {@link HasGuid}.
 * @param objs array of {@link HasGuid}.
 * @return a single {@link Guid} for the array.
 * @throws IOException
 */
public static Guid fromHasGuid(HasGuid... objs) throws IOException {
 byte[][] byteArrays = new byte[objs.length][];
 for (int i = 0; i < objs.length; i++) {
  byteArrays[i] = objs[i].guid().sha;
 }
 return fromByteArrays(byteArrays);
}

相关文章