| | |
| | | import java.nio.ByteOrder; |
| | | import java.nio.LongBuffer; |
| | | |
| | | import org.testng.Assert; |
| | | |
| | | /** |
| | | * BinConverter |
| | | * User: Ulysses |
| | |
| | | |
| | | /** |
| | | * gets bytes from an array into a long |
| | | * |
| | | * @param buffer where to get the bytes |
| | | * @param nStartIndex index from where to read the data |
| | | * @return the 64bit integer |
| | |
| | | |
| | | /** |
| | | * converts a long o bytes which are put into a given array |
| | | * |
| | | * @param lValue the 64bit integer to convert |
| | | * @param buffer the target buffer |
| | | * @param nStartIndex where to place the bytes in the buffer |
| | |
| | | |
| | | /** |
| | | * converts values from an integer array to a long |
| | | * |
| | | * @param buffer where to get the bytes |
| | | * @param nStartIndex index from where to read the data |
| | | * @return the 64bit integer |
| | |
| | | |
| | | /** |
| | | * converts a long to integers which are put into a given array |
| | | * |
| | | * @param lValue the 64bit integer to convert |
| | | * @param buffer the target buffer |
| | | * @param nStartIndex where to place the bytes in the buffer |
| | |
| | | |
| | | /** |
| | | * makes a long from two integers (treated unsigned) |
| | | * |
| | | * @param nLo lower 32bits |
| | | * @param nHi higher 32bits |
| | | * @return the built long |
| | |
| | | |
| | | /** |
| | | * gets the lower 32 bits of a long |
| | | * |
| | | * @param lVal the long integer |
| | | * @return lower 32 bits |
| | | */ |
| | |
| | | |
| | | /** |
| | | * gets the higher 32 bits of a long |
| | | * |
| | | * @param lVal the long integer |
| | | * @return higher 32 bits |
| | | */ |
| | |
| | | |
| | | /** |
| | | * converts a byte array to a binhex string |
| | | * |
| | | * @param data the byte array |
| | | * @return the binhex string |
| | | */ |
| | |
| | | |
| | | /** |
| | | * converts a byte array to a binhex string |
| | | * |
| | | * @param data the byte array |
| | | * @param nStartPos start index where to get the bytes |
| | | * @param nNumOfBytes number of bytes to convert |
| | |
| | | |
| | | /** |
| | | * converts a binhex string back into a byte array (invalid codes will be skipped) |
| | | * |
| | | * @param sBinHex binhex string |
| | | * @param data the target array |
| | | * @param nSrcPos from which character in the string the conversion should begin, |
| | |
| | | |
| | | /** |
| | | * converts a byte array into an UNICODE string |
| | | * |
| | | * @param data the byte array |
| | | * @param nStartPos where to begin the conversion |
| | | * @param nNumOfBytes number of bytes to handle |