本文整理汇总了Java中org.apache.harmony.luni.platform.Endianness类的典型用法代码示例。如果您正苦于以下问题:Java Endianness类的具体用法?Java Endianness怎么用?Java Endianness使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Endianness类属于org.apache.harmony.luni.platform包,在下文中一共展示了Endianness类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadInt
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final int loadInt(int index) {
int baseOffset = offset + index;
int bytes = 0;
if (order == Endianness.BIG_ENDIAN) {
for (int i = 0; i < 4; i++) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
} else {
for (int i = 3; i >= 0; i--) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
}
return bytes;
}
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:HeapByteBuffer.java
示例2: loadLong
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final long loadLong(int index) {
int baseOffset = offset + index;
long bytes = 0;
if (order == Endianness.BIG_ENDIAN) {
for (int i = 0; i < 8; i++) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
} else {
for (int i = 7; i >= 0; i--) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
}
return bytes;
}
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:HeapByteBuffer.java
示例3: loadInt
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final int loadInt(int index) {
int baseOffset = offset + index;
int bytes = 0;
if(order == Endianness.BIG_ENDIAN){
for (int i = 0; i < 4; i++) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
}else{
for (int i = 3; i >= 0; i--) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
}
return bytes;
}
开发者ID:artemis-esf,项目名称:quake2-gwt-port,代码行数:17,代码来源:HeapByteBuffer.java
示例4: loadLong
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final long loadLong(int index) {
int baseOffset = offset + index;
long bytes = 0;
if(order == Endianness.BIG_ENDIAN){
for (int i = 0; i < 8; i++) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
}else{
for (int i = 7; i >= 0; i--) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
}
return bytes;
}
开发者ID:artemis-esf,项目名称:quake2-gwt-port,代码行数:17,代码来源:HeapByteBuffer.java
示例5: loadInt
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final int loadInt(int index) {
int baseOffset = offset + index;
int bytes = 0;
if(order == Endianness.BIG_ENDIAN){
for (int i = 0; i < 4; i++) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
}else{
for (int i = 3; i >= 0; i--) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
}
return bytes;
}
开发者ID:freeVM,项目名称:freeVM,代码行数:17,代码来源:HeapByteBuffer.java
示例6: loadLong
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final long loadLong(int index) {
int baseOffset = offset + index;
long bytes = 0;
if(order == Endianness.BIG_ENDIAN){
for (int i = 0; i < 8; i++) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
}else{
for (int i = 7; i >= 0; i--) {
bytes = bytes << 8;
bytes = bytes | (backingArray[baseOffset + i] & 0xFF);
}
}
return bytes;
}
开发者ID:freeVM,项目名称:freeVM,代码行数:17,代码来源:HeapByteBuffer.java
示例7: loadShort
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final short loadShort(int index) {
int baseOffset = offset + index;
short bytes = 0;
if (order == Endianness.BIG_ENDIAN) {
bytes = (short) (backingArray[baseOffset] << 8);
bytes |= (backingArray[baseOffset + 1] & 0xFF);
} else {
bytes = (short) (backingArray[baseOffset + 1] << 8);
bytes |= (backingArray[baseOffset] & 0xFF);
}
return bytes;
}
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:HeapByteBuffer.java
示例8: store
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final void store(int index, int value) {
int baseOffset = offset + index;
if (order == Endianness.BIG_ENDIAN) {
for (int i = 3; i >= 0; i--) {
backingArray[baseOffset + i] = (byte) (value & 0xFF);
value = value >> 8;
}
} else {
for (int i = 0; i <= 3; i++) {
backingArray[baseOffset + i] = (byte) (value & 0xFF);
value = value >> 8;
}
}
}
开发者ID:shannah,项目名称:cn1,代码行数:15,代码来源:HeapByteBuffer.java
示例9: loadInt
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final int loadInt(int baseOffset) {
int bytes = 0;
if(order == Endianness.BIG_ENDIAN){
for (int i = 0; i < 4; i++) {
bytes = bytes << 8;
bytes = bytes | (byteArray.get(baseOffset + i) & 0xFF);
}
}else{
for (int i = 3; i >= 0; i--) {
bytes = bytes << 8;
bytes = bytes | (byteArray.get(baseOffset + i) & 0xFF);
}
}
return bytes;
}
开发者ID:artemis-esf,项目名称:quake2-gwt-port,代码行数:16,代码来源:DirectByteBuffer.java
示例10: loadLong
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final long loadLong(int baseOffset) {
long bytes = 0;
if(order == Endianness.BIG_ENDIAN){
for (int i = 0; i < 8; i++) {
bytes = bytes << 8;
bytes = bytes | (byteArray.get(baseOffset + i) & 0xFF);
}
}else{
for (int i = 7; i >= 0; i--) {
bytes = bytes << 8;
bytes = bytes | (byteArray.get(baseOffset + i) & 0xFF);
}
}
return bytes;
}
开发者ID:artemis-esf,项目名称:quake2-gwt-port,代码行数:16,代码来源:DirectByteBuffer.java
示例11: loadShort
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final short loadShort(int baseOffset) {
short bytes = 0;
if(order == Endianness.BIG_ENDIAN){
bytes = (short) (byteArray.get(baseOffset) << 8);
bytes |= (byteArray.get(baseOffset + 1) & 0xFF);
}else{
bytes = (short) (byteArray.get(baseOffset+1) << 8);
bytes |= (byteArray.get(baseOffset) & 0xFF);
}
return bytes;
}
开发者ID:artemis-esf,项目名称:quake2-gwt-port,代码行数:12,代码来源:DirectByteBuffer.java
示例12: store
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final void store(int baseOffset, int value) {
if (order == Endianness.BIG_ENDIAN) {
for (int i = 3; i >= 0; i--) {
byteArray.set(baseOffset + i, (byte) (value & 0xFF));
value = value >> 8;
}
} else {
for (int i = 0; i <= 3; i++) {
byteArray.set(baseOffset + i, (byte) (value & 0xFF));
value = value >> 8;
}
}
}
开发者ID:artemis-esf,项目名称:quake2-gwt-port,代码行数:14,代码来源:DirectByteBuffer.java
示例13: loadShort
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final short loadShort(int index) {
int baseOffset = offset + index;
short bytes = 0;
if(order == Endianness.BIG_ENDIAN){
bytes = (short) (backingArray[baseOffset] << 8);
bytes |= (backingArray[baseOffset + 1] & 0xFF);
}else{
bytes = (short) (backingArray[baseOffset+1] << 8);
bytes |= (backingArray[baseOffset] & 0xFF);
}
return bytes;
}
开发者ID:artemis-esf,项目名称:quake2-gwt-port,代码行数:13,代码来源:HeapByteBuffer.java
示例14: loadShort
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final short loadShort(int index) {
int baseOffset = offset + index;
short bytes = 0;
if(order == Endianness.BIG_ENDIAN){
bytes = (short) (backingArray[baseOffset] << 8);
bytes |= (backingArray[baseOffset + 1] & 0xFF);
}else{
bytes = (short) (backingArray[baseOffset+1] << 8);
bytes |= (backingArray[baseOffset] & 0xFF);
}
return bytes;
}
开发者ID:freeVM,项目名称:freeVM,代码行数:13,代码来源:HeapByteBuffer.java
示例15: store
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
protected final void store(int index, int value) {
int baseOffset = offset + index;
if (order == Endianness.BIG_ENDIAN) {
for (int i = 3; i >= 0; i--) {
backingArray[baseOffset + i] = (byte) (value & 0xFF);
value = value >> 8;
}
} else {
for (int i = 0; i <= 3; i++) {
backingArray[baseOffset + i] = (byte) (value & 0xFF);
value = value >> 8;
}
}
}
开发者ID:freeVM,项目名称:freeVM,代码行数:15,代码来源:HeapByteBuffer.java
示例16: orderImpl
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
ByteBuffer orderImpl(ByteOrder byteOrder) {
order = byteOrder == ByteOrder.BIG_ENDIAN ? Endianness.BIG_ENDIAN
: Endianness.LITTLE_ENDIAN;
return this;
}
开发者ID:shannah,项目名称:cn1,代码行数:6,代码来源:ByteBuffer.java
示例17: orderImpl
import org.apache.harmony.luni.platform.Endianness; //导入依赖的package包/类
ByteBuffer orderImpl(ByteOrder byteOrder) {
order = byteOrder == ByteOrder.BIG_ENDIAN ? Endianness.BIG_ENDIAN
: Endianness.LITTLE_ENDIAN;
return this;
}
开发者ID:freeVM,项目名称:freeVM,代码行数:6,代码来源:ByteBuffer.java
注:本文中的org.apache.harmony.luni.platform.Endianness类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论