热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

本文整理了Java中org.apache.hadoop.record.Buffer.copy()方法的一些代码示例,展示了Buffer.copy()

本文整理了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]);
}
}

推荐阅读
author-avatar
帅哥不潮_460
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有