public abstract class UnsafeArrayTypeReader extends AbstractTypeReader
supportsUnalignedMemoryAccess must be set according to the capabilities of the
hardware architecture: the value true allows more efficient memory access on
architectures that support unaligned memory accesses; the value false is the safe
fallback that works on every hardware.| Modifier and Type | Field and Description |
|---|---|
protected long |
byteIndex |
protected byte[] |
data |
| Modifier | Constructor and Description |
|---|---|
protected |
UnsafeArrayTypeReader(byte[] data,
long byteIndex) |
| Modifier and Type | Method and Description |
|---|---|
static UnsafeArrayTypeReader |
create(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess) |
long |
getByteIndex()
Returns the next byte index to be read.
|
int |
getS1()
Reads a signed 1 byte value.
|
static int |
getS1(byte[] data,
long byteIndex) |
static int |
getS2(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess) |
static int |
getS4(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess) |
static long |
getS8(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess) |
int |
getU1()
Reads an unsigned 1 byte value.
|
static int |
getU1(byte[] data,
long byteIndex) |
int |
getU2()
Reads an unsigned 2 byte value.
|
static int |
getU2(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess) |
long |
getU4()
Reads an unsigned 4 byte value.
|
static long |
getU4(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess) |
protected static long |
readOffset(byte[] data,
long byteIndex,
int numBytes) |
void |
setByteIndex(long byteIndex)
Sets the next byte index to be read.
|
decodeSign, getSV, getUVprotected UnsafeArrayTypeReader(byte[] data,
long byteIndex)
public static int getS1(byte[] data,
long byteIndex)
public static int getU1(byte[] data,
long byteIndex)
public static int getS2(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess)
public static int getU2(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess)
public static int getS4(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess)
public static long getU4(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess)
public static long getS8(byte[] data,
long byteIndex,
boolean supportsUnalignedMemoryAccess)
protected static long readOffset(byte[] data,
long byteIndex,
int numBytes)
public static UnsafeArrayTypeReader create(byte[] data, long byteIndex, boolean supportsUnalignedMemoryAccess)
public long getByteIndex()
TypeReaderpublic void setByteIndex(long byteIndex)
TypeReaderpublic final int getS1()
TypeReaderpublic final int getU1()
TypeReaderpublic final int getU2()
TypeReaderpublic final long getU4()
TypeReader