LibreOffice Module xmerge (master)  1
Static Public Member Functions | List of all members
org.openoffice.xmerge.util.EndianConverter Class Reference

Helper class providing static methods to convert data to/from Network Byte Order (Big Endian). More...

Static Public Member Functions

static byte[] writeShort (short value)
 Convert a. More...
 
static byte[] writeInt (int value)
 Convert an integer to a Little Endian representation. More...
 
static byte[] writeDouble (double value)
 Converts a. More...
 
static short readShort (byte[] value)
 Convert a Little Endian representation of a short to a Java. More...
 
static int readInt (byte[] value)
 Convert a Little Endian representation of an integer to a Java. More...
 
static double readDouble (byte[] value)
 Convert a Little Endian representation of a float in IEEE-754 Little Endian to a Java. More...
 

Detailed Description

Helper class providing static methods to convert data to/from Network Byte Order (Big Endian).

With the introduction of

java.nio.ByteOrder

and

java.nio.ByteBuffer

in Java 1.4, it may no longer be necessary to use this class in the future.

Version
1.1

Definition at line 34 of file EndianConverter.java.

Member Function Documentation

static double org.openoffice.xmerge.util.EndianConverter.readDouble ( byte[]  value)
inlinestatic

Convert a Little Endian representation of a float in IEEE-754 Little Endian to a Java.

double

(Network Byte Order).

An array with more than eight elements can be used, but only the first eight elements will be read.

Parameters
value

Definition at line 123 of file EndianConverter.java.

References Double.

static int org.openoffice.xmerge.util.EndianConverter.readInt ( byte[]  value)
inlinestatic

Convert a Little Endian representation of an integer to a Java.

int

(Network Byte Order).

An array with more than four elements can be used, but only the first four elements will be read.

Parameters
value

Definition at line 106 of file EndianConverter.java.

static short org.openoffice.xmerge.util.EndianConverter.readShort ( byte[]  value)
inlinestatic

Convert a Little Endian representation of a short to a Java.

short

(Network Byte Order).

An array with more than two elements can be used, but only the first two elements will be read.

Parameters
value

Definition at line 89 of file EndianConverter.java.

static byte [] org.openoffice.xmerge.util.EndianConverter.writeDouble ( double  value)
inlinestatic

Converts a.

double

to a Little Endian representation of a float in IEEE-754 format.

An array with more than eight elements can be used, but only the first eight elements will be read.

Parameters
value

Definition at line 72 of file EndianConverter.java.

References Double.

static byte [] org.openoffice.xmerge.util.EndianConverter.writeInt ( int  value)
inlinestatic

Convert an integer to a Little Endian representation.

Parameters
valueThe
int
to be converted.
Returns
Four element array containing the converted value.

Definition at line 55 of file EndianConverter.java.

static byte [] org.openoffice.xmerge.util.EndianConverter.writeShort ( short  value)
inlinestatic

Convert a.

short

to a Little Endian representation.

Parameters
valueThe
short
to be converted.
Returns
Two element array containing the converted value.

Definition at line 43 of file EndianConverter.java.


The documentation for this class was generated from the following file: