public class ByteArray extends Object
| 构造器和说明 |
|---|
ByteArray(byte[] bytes) |
| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
getBytes() |
String |
getChars(int offset,
int size) |
double |
getDouble(int offset) |
float |
getFloat(int offset) |
short |
getInt16(int offset) |
int |
getInt32(int offset) |
int |
getInt64(int offset) |
byte |
getInt8(int offset) |
long |
getLong(int offset,
int size)
小端转大端解析
long型共占用8个字节,byte占用一个字节
byte数组第一位占long型的第8位
byte数组第二位占long型的第7位
byte数组第三位占long型的第6位
byte数组第四位占long型的第5位
byte数组第五位占long型的第4位
byte数组第六位占long型的第3位
byte数组第七位占long型的第2位
byte数组第八位占long型的第1位
|
int |
getUnsignedInt16(int offset) |
int |
getUnsignedInt24(int offset) |
long |
getUnsignedInt32(int offset) |
long |
getUnsignedInt48(int offset) |
BigInteger |
getUnsignedInt64(int offset) |
short |
getUnsignedInt8(int offset) |
int |
length() |
ByteArray |
putChars(String value,
int offset) |
ByteArray |
putDouble(long value,
int offset) |
ByteArray |
putFloat(float value,
int offset) |
ByteArray |
putInt16(int value,
int offset) |
ByteArray |
putInt32(long value,
int offset) |
ByteArray |
putInt64(long value,
int offset) |
ByteArray |
putInt8(int value,
int offset) |
ByteArray |
putLong(long value,
int offset,
int size) |
ByteArray |
putUnsignedInt16(int value,
int offset) |
ByteArray |
putUnsignedInt24(int value,
int offset) |
ByteArray |
putUnsignedInt32(long value,
int offset) |
ByteArray |
putUnsignedInt48(long value,
int offset) |
ByteArray |
putUnsignedInt64(long value,
int offset) |
ByteArray |
putUnsignedInt8(int value,
int offset) |
byte[] |
slice(int offset,
int size) |
public byte[] getBytes()
public byte getInt8(int offset)
public short getUnsignedInt8(int offset)
public ByteArray putInt8(int value, int offset)
public ByteArray putUnsignedInt8(int value, int offset)
public short getInt16(int offset)
public int getUnsignedInt16(int offset)
public ByteArray putInt16(int value, int offset)
public ByteArray putUnsignedInt16(int value, int offset)
public int getUnsignedInt24(int offset)
public ByteArray putUnsignedInt24(int value, int offset)
public int getInt32(int offset)
public long getUnsignedInt32(int offset)
public ByteArray putInt32(long value, int offset)
public ByteArray putUnsignedInt32(long value, int offset)
public long getUnsignedInt48(int offset)
public ByteArray putUnsignedInt48(long value, int offset)
public int getInt64(int offset)
public BigInteger getUnsignedInt64(int offset)
public ByteArray putInt64(long value, int offset)
public ByteArray putUnsignedInt64(long value, int offset)
public float getFloat(int offset)
public ByteArray putFloat(float value, int offset)
public double getDouble(int offset)
public ByteArray putDouble(long value, int offset)
public String getChars(int offset, int size)
public byte[] slice(int offset,
int size)
public long getLong(int offset,
int size)
offset - 偏移量size - 字节数量public ByteArray putLong(long value, int offset, int size)
public int length()
Copyright © 2020. All rights reserved.