openlsd.common.LSDByteToByte Class Reference

Collaboration diagram for openlsd.common.LSDByteToByte:

Collaboration graph
[legend]

List of all members.


Detailed Description

Tools for byte and file manipulation

Author:
Frederic Bregier LGPL

Static Public Member Functions

static byte[] newbytefromoffset (byte[] from, int rank, int blocksize)
static byte[] newbytefromprevious (byte[] previous, byte[] addbytes)
static boolean copysubsettooffset (byte[] from, int offsetsrc, int length, byte[] tooffset, int offsetdst)
static boolean bytesEqualBytes (byte[] from, byte[] to)
static byte[] bytesFromFile (String filename)

Static Protected Attributes

static final byte[] test

Member Function Documentation

static byte [] openlsd.common.LSDByteToByte.newbytefromoffset ( byte[]  from,
int  rank,
int  blocksize 
) [static]

Create a sub array of byte from the array 'from', starting at position (rank-1)*blocksize up to rank*blocksize-1.

Parameters:
from 
rank 
blocksize 
Returns:
the sub byte from offset or null if error

static byte [] openlsd.common.LSDByteToByte.newbytefromprevious ( byte[]  previous,
byte[]  addbytes 
) [static]

Add to previous the array of byte addbytes at the end and return the new array.

Parameters:
previous 
addbytes 
Returns:
the array being the concatenation of both byte arrays or null if error

static boolean openlsd.common.LSDByteToByte.copysubsettooffset ( byte[]  from,
int  offsetsrc,
int  length,
byte[]  tooffset,
int  offsetdst 
) [static]

Copy a sub array of byte to an offset position.

Parameters:
from array of byte source
offsetsrc position (offset) in source
length length of bytes to copy
tooffset array of byte destination
offsetdst position (offset) in destination
Returns:
True if OK, False if KO.

static boolean openlsd.common.LSDByteToByte.bytesEqualBytes ( byte[]  from,
byte[]  to 
) [static]

Check if array of bytes are equals

Parameters:
from 
to 
Returns:
True if equals, False if not

static byte [] openlsd.common.LSDByteToByte.bytesFromFile ( String  filename  )  [static]

Load a file from filename in a array of byte (function no more used)

Parameters:
filename 
Returns:
the array of byte from the file, or null
Deprecated:
This function is no more used


Member Data Documentation

final byte [] openlsd.common.LSDByteToByte.test [static, protected]

Initial value:

 
        ("1234567890abcdefghij1234567890abcdefghij1234567890").getBytes()
Test object only


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