public class ByteArrayMarshaller
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
writeDouble(double value,
byte[] byteArray,
int offset,
boolean bigEndian)
Copies the double value into eight consecutive bytes of the byte array
starting at the offset.
|
static void |
writeFloat(float value,
byte[] byteArray,
int offset,
boolean bigEndian)
Copies the float value into four consecutive bytes of the byte array
starting at the offset.
|
static void |
writeInt(int value,
byte[] byteArray,
int offset,
boolean bigEndian)
Copies an int value into four consecutive bytes of the byte array
starting at the offset.
|
static void |
writeInt(int value,
byte[] byteArray,
int offset,
boolean bigEndian,
int numBytes)
Copies zero to four bytes of the int value into the byte array starting
at the offset.
|
static void |
writeLong(long value,
byte[] byteArray,
int offset,
boolean bigEndian)
Copies the long value into eight consecutive bytes of the byte array
starting at the offset.
|
static void |
writeLong(long value,
byte[] byteArray,
int offset,
boolean bigEndian,
int numBytes)
Copies zero to eight bytes of the long value into the byte array starting
at the offset.
|
static void |
writeShort(short value,
byte[] byteArray,
int offset,
boolean bigEndian)
Copies the short value into two consecutive bytes of the byte array
starting at the offset.
|
static void |
writeShort(short value,
byte[] byteArray,
int offset,
boolean bigEndian,
int numBytes)
Copies zero to two bytes of the short value into the byte array starting
at the offset.
|
public static void writeShort(short value,
byte[] byteArray,
int offset,
boolean bigEndian)
value - the short value to marshallbyteArray - destinationoffset - offset in the byte arraybigEndian - if false the bytes will be copied in reverse (little endian)
orderjava.lang.NullPointerException - if byteArray is nulljava.lang.ArrayIndexOutOfBoundsException - if an invalid array access occurspublic static void writeShort(short value,
byte[] byteArray,
int offset,
boolean bigEndian,
int numBytes)
value - the short value to marshallbyteArray - destinationoffset - offset in the byte arraybigEndian - if false the bytes will be copied in reverse (little endian)
ordernumBytes - the number of bytes to marshal, must be 0-2 inclusivejava.lang.NullPointerException - if byteArray is nulljava.lang.IllegalArgumentException - if numBytes < 0 or
numBytes > 2java.lang.ArrayIndexOutOfBoundsException - if an invalid array access occurspublic static void writeInt(int value,
byte[] byteArray,
int offset,
boolean bigEndian)
value - the int value to marshallbyteArray - destinationoffset - offset in the byte arraybigEndian - if false the bytes will be copied in reverse (little endian)
orderjava.lang.NullPointerException - if byteArray is nulljava.lang.ArrayIndexOutOfBoundsException - if an invalid array access occurspublic static void writeInt(int value,
byte[] byteArray,
int offset,
boolean bigEndian,
int numBytes)
value - the int value to marshallbyteArray - destinationoffset - offset in the byte arraybigEndian - if false the bytes will be copied in reverse (little endian)
ordernumBytes - the number of bytes to marshall, must be 0-4 inclusivejava.lang.NullPointerException - if byteArray is nulljava.lang.IllegalArgumentException - if numBytes < 0 or
numBytes > 4java.lang.ArrayIndexOutOfBoundsException - if an invalid array access occurspublic static void writeLong(long value,
byte[] byteArray,
int offset,
boolean bigEndian)
value - the long value to marshallbyteArray - destinationoffset - offset in the byte arraybigEndian - if false the bytes will be copied in reverse (little endian)
orderjava.lang.NullPointerException - if byteArray is nulljava.lang.ArrayIndexOutOfBoundsException - if an invalid array access occurspublic static void writeLong(long value,
byte[] byteArray,
int offset,
boolean bigEndian,
int numBytes)
value - the long value to marshallbyteArray - destinationoffset - offset in the byte arraybigEndian - if false the bytes will be copied in reverse (little endian)
ordernumBytes - the number of bytes to marshal, must be 0-8 inclusivejava.lang.NullPointerException - if byteArray is nulljava.lang.IllegalArgumentException - if numBytes < 0 or
numBytes > 8java.lang.ArrayIndexOutOfBoundsException - if an invalid array access occurspublic static void writeFloat(float value,
byte[] byteArray,
int offset,
boolean bigEndian)
value - the float value to marshallbyteArray - destinationoffset - offset in the byte arraybigEndian - if false the bytes will be copied in reverse (little endian)
orderjava.lang.NullPointerException - if byteArray is nulljava.lang.ArrayIndexOutOfBoundsException - if an invalid array access occurspublic static void writeDouble(double value,
byte[] byteArray,
int offset,
boolean bigEndian)
value - the double value to marshallbyteArray - destinationoffset - offset in the byte arraybigEndian - if false the bytes will be copied in reverse (little endian)
orderjava.lang.NullPointerException - if byteArray is nulljava.lang.ArrayIndexOutOfBoundsException - if an invalid array access occursEclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 2013, 2025 IBM Corp. and others.
DRAFT internal-b00