fm.liveswitch.FileAssistant Class Reference

A utility class for reading/writing from/to a fm.liveswitch.FileAssistant#getFile. More...

Public Member Functions

 FileAssistant (fm.liveswitch.FileStream file)
 Initializes a new instance of the fm.liveswitch.FileAssistant class. More...
 
fm.liveswitch.FileStream getFile ()
 Gets the file. More...
 
boolean getLittleEndian ()
 Gets whether to read/write using little-endian ordering. More...
 
byte[] read (int length)
 Reads a value from a File. More...
 
int read16 ()
 Converts a 16-bit network representation to an integer. More...
 
int read24 ()
 Converts a 24-bit network representation to an integer. More...
 
long read32 ()
 Converts a 32-bit network representation to an integer. More...
 
long read40 ()
 Converts a 40-bit network representation to an integer. More...
 
long read48 ()
 Converts a 48-bit network representation to an integer. More...
 
long read56 ()
 Converts a 56-bit network representation to an integer. More...
 
long read64 ()
 Converts a 64-bit network representation to an integer. More...
 
int read8 ()
 Converts an 8-bit network representation to an integer. More...
 
byte[] readOpaque16 ()
 Reads a 16-bit-length opaque value from a File. More...
 
byte[] readOpaque24 ()
 Reads a 24-bit-length opaque value from a File. More...
 
byte[] readOpaque32 ()
 Reads a 32-bit-length opaque value from a File. More...
 
byte[] readOpaque8 ()
 Reads an 8-bit-length opaque value from a File. More...
 
void setLittleEndian (boolean value)
 Sets whether to read/write using little-endian ordering. More...
 
void write (byte[] value)
 Adds a value to a File. More...
 
void write (byte[] value, int offset, int length)
 Adds a value to a File. More...
 
void write16 (int value)
 Adds a 16-bit value to a File. More...
 
void write16To (int location, int value)
 Adds a 16-bit value to a File. More...
 
void write24 (int value)
 Adds a 24-bit value to a File. More...
 
void write24To (int location, int value)
 Adds a 24-bit value to a File. More...
 
void write32 (long value)
 Adds a 32-bit value to a File. More...
 
void write32To (int location, long value)
 Adds a 32-bit value to a File. More...
 
void write40 (long value)
 Adds a 40-bit value to a File. More...
 
void write40To (int location, long value)
 Adds a 40-bit value to a File. More...
 
void write48 (long value)
 Adds a 48-bit value to a File. More...
 
void write48To (int location, long value)
 Adds a 48-bit value to a File. More...
 
void write56 (long value)
 Adds a 56-bit value to a File. More...
 
void write56To (int location, long value)
 Adds a 56-bit value to a File. More...
 
void write64 (long value)
 Adds a 64-bit value to a File. More...
 
void write64To (int location, long value)
 Adds a 64-bit value to a File. More...
 
void write8 (int value)
 Adds an 8-bit value to a File. More...
 
void write8To (int location, int value)
 Adds an 8-bit value to a File. More...
 
void writeOpaque16 (byte[] value)
 Adds a 16-bit-length opaque value to a File. More...
 
void writeOpaque16To (int location, byte[] value)
 Adds a 16-bit-length opaque value to a File. More...
 
void writeOpaque24 (byte[] value)
 Adds a 24-bit-length opaque value to a File. More...
 
void writeOpaque24To (int location, byte[] value)
 Adds a 24-bit-length opaque value to a File. More...
 
void writeOpaque32 (byte[] value)
 Adds a 32-bit-length opaque value to a File. More...
 
void writeOpaque32To (int location, byte[] value)
 Adds a 32-bit-length opaque value to a File. More...
 
void writeOpaque40 (byte[] value)
 Adds a 40-bit-length opaque value to a File. More...
 
void writeOpaque40To (int location, byte[] value)
 Adds a 40-bit-length opaque value to a File. More...
 
void writeOpaque48 (byte[] value)
 Adds a 48-bit-length opaque value to a File. More...
 
void writeOpaque48To (int location, byte[] value)
 Adds a 48-bit-length opaque value to a File. More...
 
void writeOpaque56 (byte[] value)
 Adds a 56-bit-length opaque value to a File. More...
 
void writeOpaque56To (int location, byte[] value)
 Adds a 56-bit-length opaque value to a File. More...
 
void writeOpaque64 (byte[] value)
 Adds a 64-bit-length opaque value to a File. More...
 
void writeOpaque64To (int location, byte[] value)
 Adds a 64-bit-length opaque value to a File. More...
 
void writeOpaque8 (byte[] value)
 Adds an 8-bit-length opaque value to a File. More...
 
void writeOpaque8To (int location, byte[] value)
 Adds an 8-bit-length opaque value to a File. More...
 
void writeTo (int location, byte[] value)
 Adds a value to a File. More...
 

Static Public Member Functions

static byte[] readAllBytes (String path)
 Reads all the bytes of a file into a byte array. More...
 

Detailed Description

A utility class for reading/writing from/to a fm.liveswitch.FileAssistant#getFile.

Constructor & Destructor Documentation

◆ FileAssistant()

fm.liveswitch.FileAssistant.FileAssistant ( fm.liveswitch.FileStream  file)

Initializes a new instance of the fm.liveswitch.FileAssistant class.

Parameters
fileThe file.

Member Function Documentation

◆ getFile()

fm.liveswitch.FileStream fm.liveswitch.FileAssistant.getFile ( )

Gets the file.

◆ getLittleEndian()

boolean fm.liveswitch.FileAssistant.getLittleEndian ( )

Gets whether to read/write using little-endian ordering.

◆ read()

byte [] fm.liveswitch.FileAssistant.read ( int  length)

Reads a value from a File.

Parameters
lengthThe number of bytes to read.

◆ read16()

int fm.liveswitch.FileAssistant.read16 ( )

Converts a 16-bit network representation to an integer.

◆ read24()

int fm.liveswitch.FileAssistant.read24 ( )

Converts a 24-bit network representation to an integer.

◆ read32()

long fm.liveswitch.FileAssistant.read32 ( )

Converts a 32-bit network representation to an integer.

◆ read40()

long fm.liveswitch.FileAssistant.read40 ( )

Converts a 40-bit network representation to an integer.

◆ read48()

long fm.liveswitch.FileAssistant.read48 ( )

Converts a 48-bit network representation to an integer.

◆ read56()

long fm.liveswitch.FileAssistant.read56 ( )

Converts a 56-bit network representation to an integer.

◆ read64()

long fm.liveswitch.FileAssistant.read64 ( )

Converts a 64-bit network representation to an integer.

◆ read8()

int fm.liveswitch.FileAssistant.read8 ( )

Converts an 8-bit network representation to an integer.

◆ readAllBytes()

static byte [] fm.liveswitch.FileAssistant.readAllBytes ( String  path)
static

Reads all the bytes of a file into a byte array.

Parameters
pathThe filepath to the file to read.

◆ readOpaque16()

byte [] fm.liveswitch.FileAssistant.readOpaque16 ( )

Reads a 16-bit-length opaque value from a File.

◆ readOpaque24()

byte [] fm.liveswitch.FileAssistant.readOpaque24 ( )

Reads a 24-bit-length opaque value from a File.

◆ readOpaque32()

byte [] fm.liveswitch.FileAssistant.readOpaque32 ( )

Reads a 32-bit-length opaque value from a File.

◆ readOpaque8()

byte [] fm.liveswitch.FileAssistant.readOpaque8 ( )

Reads an 8-bit-length opaque value from a File.

◆ setLittleEndian()

void fm.liveswitch.FileAssistant.setLittleEndian ( boolean  value)

Sets whether to read/write using little-endian ordering.

◆ write() [1/2]

void fm.liveswitch.FileAssistant.write ( byte[]  value)

Adds a value to a File.

Parameters
valueThe value.

◆ write() [2/2]

void fm.liveswitch.FileAssistant.write ( byte[]  value,
int  offset,
int  length 
)

Adds a value to a File.

Parameters
valueThe value.
offsetThe offset.
lengthThe length.

◆ write16()

void fm.liveswitch.FileAssistant.write16 ( int  value)

Adds a 16-bit value to a File.

Parameters
valueThe value.

◆ write16To()

void fm.liveswitch.FileAssistant.write16To ( int  location,
int  value 
)

Adds a 16-bit value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ write24()

void fm.liveswitch.FileAssistant.write24 ( int  value)

Adds a 24-bit value to a File.

Parameters
valueThe value.

◆ write24To()

void fm.liveswitch.FileAssistant.write24To ( int  location,
int  value 
)

Adds a 24-bit value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ write32()

void fm.liveswitch.FileAssistant.write32 ( long  value)

Adds a 32-bit value to a File.

Parameters
valueThe value.

◆ write32To()

void fm.liveswitch.FileAssistant.write32To ( int  location,
long  value 
)

Adds a 32-bit value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ write40()

void fm.liveswitch.FileAssistant.write40 ( long  value)

Adds a 40-bit value to a File.

Parameters
valueThe value.

◆ write40To()

void fm.liveswitch.FileAssistant.write40To ( int  location,
long  value 
)

Adds a 40-bit value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ write48()

void fm.liveswitch.FileAssistant.write48 ( long  value)

Adds a 48-bit value to a File.

Parameters
valueThe value.

◆ write48To()

void fm.liveswitch.FileAssistant.write48To ( int  location,
long  value 
)

Adds a 48-bit value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ write56()

void fm.liveswitch.FileAssistant.write56 ( long  value)

Adds a 56-bit value to a File.

Parameters
valueThe value.

◆ write56To()

void fm.liveswitch.FileAssistant.write56To ( int  location,
long  value 
)

Adds a 56-bit value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ write64()

void fm.liveswitch.FileAssistant.write64 ( long  value)

Adds a 64-bit value to a File.

Parameters
valueThe value.

◆ write64To()

void fm.liveswitch.FileAssistant.write64To ( int  location,
long  value 
)

Adds a 64-bit value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ write8()

void fm.liveswitch.FileAssistant.write8 ( int  value)

Adds an 8-bit value to a File.

Parameters
valueThe value.

◆ write8To()

void fm.liveswitch.FileAssistant.write8To ( int  location,
int  value 
)

Adds an 8-bit value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ writeOpaque16()

void fm.liveswitch.FileAssistant.writeOpaque16 ( byte[]  value)

Adds a 16-bit-length opaque value to a File.

Parameters
valueThe value.

◆ writeOpaque16To()

void fm.liveswitch.FileAssistant.writeOpaque16To ( int  location,
byte[]  value 
)

Adds a 16-bit-length opaque value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ writeOpaque24()

void fm.liveswitch.FileAssistant.writeOpaque24 ( byte[]  value)

Adds a 24-bit-length opaque value to a File.

Parameters
valueThe value.

◆ writeOpaque24To()

void fm.liveswitch.FileAssistant.writeOpaque24To ( int  location,
byte[]  value 
)

Adds a 24-bit-length opaque value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ writeOpaque32()

void fm.liveswitch.FileAssistant.writeOpaque32 ( byte[]  value)

Adds a 32-bit-length opaque value to a File.

Parameters
valueThe value.

◆ writeOpaque32To()

void fm.liveswitch.FileAssistant.writeOpaque32To ( int  location,
byte[]  value 
)

Adds a 32-bit-length opaque value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ writeOpaque40()

void fm.liveswitch.FileAssistant.writeOpaque40 ( byte[]  value)

Adds a 40-bit-length opaque value to a File.

Parameters
valueThe value.

◆ writeOpaque40To()

void fm.liveswitch.FileAssistant.writeOpaque40To ( int  location,
byte[]  value 
)

Adds a 40-bit-length opaque value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ writeOpaque48()

void fm.liveswitch.FileAssistant.writeOpaque48 ( byte[]  value)

Adds a 48-bit-length opaque value to a File.

Parameters
valueThe value.

◆ writeOpaque48To()

void fm.liveswitch.FileAssistant.writeOpaque48To ( int  location,
byte[]  value 
)

Adds a 48-bit-length opaque value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ writeOpaque56()

void fm.liveswitch.FileAssistant.writeOpaque56 ( byte[]  value)

Adds a 56-bit-length opaque value to a File.

Parameters
valueThe value.

◆ writeOpaque56To()

void fm.liveswitch.FileAssistant.writeOpaque56To ( int  location,
byte[]  value 
)

Adds a 56-bit-length opaque value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ writeOpaque64()

void fm.liveswitch.FileAssistant.writeOpaque64 ( byte[]  value)

Adds a 64-bit-length opaque value to a File.

Parameters
valueThe value.

◆ writeOpaque64To()

void fm.liveswitch.FileAssistant.writeOpaque64To ( int  location,
byte[]  value 
)

Adds a 64-bit-length opaque value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ writeOpaque8()

void fm.liveswitch.FileAssistant.writeOpaque8 ( byte[]  value)

Adds an 8-bit-length opaque value to a File.

Parameters
valueThe value.

◆ writeOpaque8To()

void fm.liveswitch.FileAssistant.writeOpaque8To ( int  location,
byte[]  value 
)

Adds an 8-bit-length opaque value to a File.

Parameters
locationThe location to write to.
valueThe value.

◆ writeTo()

void fm.liveswitch.FileAssistant.writeTo ( int  location,
byte[]  value 
)

Adds a value to a File.

Parameters
locationThe location to write to.
valueThe value.