本文整理匯總了Java中io.netty.util.internal.PlatformDependent.putByte方法的典型用法代碼示例。如果您正苦於以下問題:Java PlatformDependent.putByte方法的具體用法?Java PlatformDependent.putByte怎麽用?Java PlatformDependent.putByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.netty.util.internal.PlatformDependent
的用法示例。
在下文中一共展示了PlatformDependent.putByte方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: copy
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
@Override
public void copy(long compoundAddr, int srcStart, final int count) {
copyWatch.start();
final long[] dstAddrs = this.dstAddrs;
// skip bytes, but make sure to account for the remaining bits too
final long srcAddr = source.getFieldBuffers().get(bufferOrdinal).memoryAddress();
final long max = compoundAddr + count * OFFSET_SIZE;
for(; compoundAddr < max; compoundAddr +=OFFSET_SIZE, srcStart++){
final int compoundIdx = PlatformDependent.getInt(compoundAddr);
final int batchIdx = compoundIdx >>> 16;
final int rowIdx = compoundIdx & 65535;
final int byteValue = PlatformDependent.getByte(srcAddr + (srcStart >>> 3));
final int bitVal = ((byteValue >>> (srcStart & 7)) & 1) << (rowIdx & 7);
final long dstAddr = dstAddrs[batchIdx] + (rowIdx >>> 3);
PlatformDependent.putByte(dstAddr, (byte) (PlatformDependent.getByte(dstAddr) | bitVal));
}
copyWatch.stop();
}
示例2: copy
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
@Override
public void copy(long offsetAddr, int count) {
if(allocateAsFixed){
targetAlt.allocateNew(count);
}
final long[] srcAddr = this.srcAddrs;
final long dstAddr = target.getFieldBuffers().get(bufferOrdinal).memoryAddress();
final long maxAddr = offsetAddr + count * STEP_SIZE;
int targetIndex = 0;
for(; offsetAddr < maxAddr; offsetAddr += STEP_SIZE, targetIndex++){
final int batchNOFF = PlatformDependent.getInt(offsetAddr);
final int recordIndex = batchNOFF & MAX_BATCH;
final int byteValue = PlatformDependent.getByte(srcAddr[batchNOFF >>> BATCH_BITS] + (recordIndex >>> 3));
final int bitVal = ((byteValue >>> (recordIndex & 7)) & 1) << (targetIndex & 7);
final long addr = dstAddr + (targetIndex >>> 3);
PlatformDependent.putByte(addr, (byte) (PlatformDependent.getByte(addr) | bitVal));
}
}
示例3: copy
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
@Override
public void copy(long offsetAddr, int count) {
if(allocateAsFixed){
targetAlt.allocateNew(count);
}
final long[] srcAddr = this.srcAddrs;
final long dstAddr = target.getFieldBuffers().get(bufferOrdinal).memoryAddress();
final long maxAddr = offsetAddr + count * BUILD_RECORD_LINK_SIZE;
int targetIndex = 0;
for(; offsetAddr < maxAddr; offsetAddr += BUILD_RECORD_LINK_SIZE, targetIndex++){
final int batchIndex = PlatformDependent.getInt(offsetAddr);
if(batchIndex != SKIP){
final int batchOffset = PlatformDependent.getShort(offsetAddr + 4);
final int byteValue = PlatformDependent.getByte(srcAddr[batchIndex] + (batchOffset >>> 3));
final int bitVal = ((byteValue >>> (batchOffset & 7)) & 1) << (targetIndex & 7);
final long addr = dstAddr + (targetIndex >>> 3);
PlatformDependent.putByte(addr, (byte) (PlatformDependent.getByte(addr) | bitVal));
}
}
}
示例4: copy
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
@Override
public void copy(long offsetAddr, int count) {
if(allocateAsFixed){
targetAlt.allocateNew(count);
}
final long[] srcAddr = this.srcAddrs;
final long dstAddr = target.getFieldBuffers().get(bufferOrdinal).memoryAddress();
final long maxAddr = offsetAddr + count * BUILD_RECORD_LINK_SIZE;
int targetIndex = 0;
for(; offsetAddr < maxAddr; offsetAddr += BUILD_RECORD_LINK_SIZE, targetIndex++){
final int batchIndex = PlatformDependent.getInt(offsetAddr);
final int batchOffset = PlatformDependent.getShort(offsetAddr + 4);
final int byteValue = PlatformDependent.getByte(srcAddr[batchIndex] + (batchOffset >>> 3));
final int bitVal = ((byteValue >>> (batchOffset & 7)) & 1) << (targetIndex & 7);
final long addr = dstAddr + (targetIndex >>> 3);
PlatformDependent.putByte(addr, (byte) (PlatformDependent.getByte(addr) | bitVal));
}
}
示例5: copy
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
@Override
public void copy(long offsetAddr, int count) {
if(allocateAsFixed){
targetAlt.allocateNew(count);
}
final long srcAddr = source.getFieldBuffers().get(bufferOrdinal).memoryAddress();
final long dstAddr = target.getFieldBuffers().get(bufferOrdinal).memoryAddress();
final long maxAddr = offsetAddr + count * STEP_SIZE;
int targetIndex = 0;
for(; offsetAddr < maxAddr; offsetAddr += STEP_SIZE, targetIndex++){
final int recordIndex = (char) PlatformDependent.getShort(offsetAddr);
final int byteValue = PlatformDependent.getByte(srcAddr + (recordIndex >>> 3));
final int bitVal = ((byteValue >>> (recordIndex & 7)) & 1) << (targetIndex & 7);
final long addr = dstAddr + (targetIndex >>> 3);
PlatformDependent.putByte(addr, (byte) (PlatformDependent.getByte(addr) | bitVal));
}
}
示例6: handCopy
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
public static final void handCopy(final long src, final long dst, int len) {
int n = len;
long lPos = src;
long rPos = dst;
while (n > 7) {
PlatformDependent.putLong(rPos, PlatformDependent.getLong(lPos));
lPos += 8;
rPos += 8;
n -= 8;
}
while (n > 3) {
PlatformDependent.putInt(rPos, PlatformDependent.getInt(lPos));
lPos += 4;
rPos += 4;
n -= 4;
}
while (n-- != 0) {
PlatformDependent.putByte(rPos, PlatformDependent.getByte(lPos));
lPos++;
rPos++;
}
}
示例7: append
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
@Override
public void append(byte data) {
if(!collect){
return;
}
if(characterData >= characterDataMax){
expandVarCharData();
}
PlatformDependent.putByte(characterData, data);
characterData++;
}
示例8: writeWordwise
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
public static void writeWordwise(long addr, int length, long value) {
if (length == 0) {
return;
}
int nLong = length >>> 3;
int nBytes = length & 7;
for (int i = nLong; i > 0; i--) {
PlatformDependent.putLong(addr, value);
addr += 8;
}
if (nBytes == 4) {
PlatformDependent.putInt(addr, (int) value);
addr += 4;
} else if (nBytes < 4) {
for (int i = nBytes; i > 0; i--) {
PlatformDependent.putByte(addr, (byte) value);
addr++;
}
} else {
PlatformDependent.putInt(addr, (int) value);
addr += 4;
for (int i = nBytes - 4; i > 0; i--) {
PlatformDependent.putByte(addr, (byte) value);
addr++;
}
}
}
示例9: setByte
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
@Override
public ByteBuf setByte(int index, int value) {
chk(index, 1);
PlatformDependent.putByte(addr(index), (byte) value);
return this;
}
示例10: writeByteUnsafe
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
public void writeByteUnsafe(byte b){
PlatformDependent.putByte(addr(readerIndex), b);
readerIndex++;
}
示例11: setByte
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
@Override
public ByteBuf setByte(int index, int value) {
PlatformDependent.putByte(addr(index), (byte) value);
return this;
}
示例12: handCopy2
import io.netty.util.internal.PlatformDependent; //導入方法依賴的package包/類
public static final void handCopy2(final long src, final long dst, int len) {
int n = len;
long lPos = src;
long rPos = dst;
while (n > 7) {
PlatformDependent.putLong(rPos, PlatformDependent.getLong(lPos));
lPos += 8;
rPos += 8;
n -= 8;
}
switch(n){
case 7:
PlatformDependent.putInt(rPos, PlatformDependent.getInt(lPos));
PlatformDependent.putByte(rPos + 4, PlatformDependent.getByte(lPos + 4));
PlatformDependent.putByte(rPos + 5, PlatformDependent.getByte(lPos + 5));
PlatformDependent.putByte(rPos + 6, PlatformDependent.getByte(lPos + 6));
break;
case 6:
PlatformDependent.putInt(rPos, PlatformDependent.getInt(lPos));
PlatformDependent.putByte(rPos + 4, PlatformDependent.getByte(lPos + 4));
PlatformDependent.putByte(rPos + 5, PlatformDependent.getByte(lPos + 5));
break;
case 5:
PlatformDependent.putInt(rPos, PlatformDependent.getInt(lPos));
PlatformDependent.putByte(rPos + 4, PlatformDependent.getByte(lPos + 4));
break;
case 4:
PlatformDependent.putInt(rPos, PlatformDependent.getInt(lPos));
break;
case 3:
PlatformDependent.putByte(rPos, PlatformDependent.getByte(lPos));
PlatformDependent.putByte(rPos + 1, PlatformDependent.getByte(lPos + 1));
PlatformDependent.putByte(rPos + 2, PlatformDependent.getByte(lPos + 2));
break;
case 2:
PlatformDependent.putByte(rPos, PlatformDependent.getByte(lPos));
PlatformDependent.putByte(rPos + 1, PlatformDependent.getByte(lPos + 1));
break;
case 1:
PlatformDependent.putByte(rPos, PlatformDependent.getByte(lPos));
break;
}
}