org.apache.hadoop.record.Buffer.copy()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(67)

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

Buffer.copy介绍

[英]Copy the specified byte array to the Buffer. Replaces the current buffer.
[中]将指定的字节数组复制到缓冲区。替换当前缓冲区。

代码示例

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Create a Buffer using the byte range as the initial value.
 *
 * @param bytes Copy of this array becomes the backing storage for the object.
 * @param offset offset into byte array
 * @param length length of data
 */
public Buffer(byte[] bytes, int offset, int length) {
 copy(bytes, offset, length);
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Create a Buffer using the byte range as the initial value.
 *
 * @param bytes Copy of this array becomes the backing storage for the object.
 * @param offset offset into byte array
 * @param length length of data
 */
public Buffer(byte[] bytes, int offset, int length) {
 copy(bytes, offset, length);
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/**
 * Create a Buffer using the byte range as the initial value.
 *
 * @param bytes Copy of this array becomes the backing storage for the object.
 * @param offset offset into byte array
 * @param length length of data
 */
public Buffer(byte[] bytes, int offset, int length) {
 copy(bytes, offset, length);
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

/**
 * Create a Buffer using the byte range as the initial value.
 *
 * @param bytes Copy of this array becomes the backing storage for the object.
 * @param offset offset into byte array
 * @param length length of data
 */
public Buffer(byte[] bytes, int offset, int length) {
 copy(bytes, offset, length);
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Create a Buffer using the byte range as the initial value.
 *
 * @param bytes Copy of this array becomes the backing storage for the object.
 * @param offset offset into byte array
 * @param length length of data
 */
public Buffer(byte[] bytes, int offset, int length) {
 copy(bytes, offset, length);
}

代码示例来源:origin: org.apache.hadoop/hadoop-streaming

/**
 * Create a Buffer using the byte range as the initial value.
 *
 * @param bytes Copy of this array becomes the backing storage for the object.
 * @param offset offset into byte array
 * @param length length of data
 */
public Buffer(byte[] bytes, int offset, int length) {
 copy(bytes, offset, length);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Create a Buffer using the byte range as the initial value.
 *
 * @param bytes Copy of this array becomes the backing storage for the object.
 * @param offset offset into byte array
 * @param length length of data
 */
public Buffer(byte[] bytes, int offset, int length) {
 copy(bytes, offset, length);
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

public Object clone() throws CloneNotSupportedException {
  Buffer result = (Buffer) super.clone();
  result.copy(this.get(), 0, this.getCount());
  return result;
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-streaming

@Override
 public Object clone() throws CloneNotSupportedException {
  Buffer result = (Buffer) super.clone();
  result.copy(this.get(), 0, this.getCount());
  return result;
 }
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@Override
 public Object clone() throws CloneNotSupportedException {
  Buffer result = (Buffer) super.clone();
  result.copy(this.get(), 0, this.getCount());
  return result;
 }
}

代码示例来源:origin: io.hops/hadoop-common

@Override
 public Object clone() throws CloneNotSupportedException {
  Buffer result = (Buffer) super.clone();
  result.copy(this.get(), 0, this.getCount());
  return result;
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@Override
 public Object clone() throws CloneNotSupportedException {
  Buffer result = (Buffer) super.clone();
  result.copy(this.get(), 0, this.getCount());
  return result;
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Override
 public Object clone() throws CloneNotSupportedException {
  Buffer result = (Buffer) super.clone();
  result.copy(this.get(), 0, this.getCount());
  return result;
 }
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

public Object clone() throws CloneNotSupportedException {
  Buffer result = (Buffer) super.clone();
  result.copy(this.get(), 0, this.getCount());
  return result;
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common-test

/**
 * Test of copy method, of class org.apache.hadoop.record.Buffer.
 */
public void testCopy() {
 final byte[] bytes = new byte[10];
 final int offset = 6;
 final int length = 3;
 for (int idx = 0; idx < 10; idx ++) {
  bytes[idx] = (byte) idx;
 }
 final Buffer instance = new Buffer();
 
 instance.copy(bytes, offset, length);
 
 assertEquals("copy failed", 3, instance.getCapacity());
 assertEquals("copy failed", 3, instance.get().length);
 for (int idx = 0; idx < 3; idx++) {
  assertEquals("Buffer content corrupted", idx+6, instance.get()[idx]);
 }
}

相关文章