org.apache.cocoon.components.midi.xmidi
Class Utils

java.lang.Object
  extended by org.apache.cocoon.components.midi.xmidi.Utils

public final class Utils
extends Object


Field Summary
static String VERSION
           
 
Constructor Summary
Utils()
           
 
Method Summary
static String baToHex(byte[] b, int strt, int end)
          convert byte array to hex string
static int baToInt(byte[] b, int strt, int end)
          convert byte array to int
static String baToString(byte[] b, int strt, int end)
          convert byte array to string (not hex)
static ByteLen deltaToInt(byte[] b, int offset)
          convert delta time to byte array a delta time is expressed as a byte array, length unknown (4 or less)
static int getNextHiOrd(byte[] dta, int offset)
           
static int getPW(byte[] dta, int offset)
           
static int getUnsignedByte(byte b)
          convert byte (unsigned) to int
static byte[] hexToBa(String h, int len)
          convert hex string to byte array
static byte[] intToBa(int n, int c)
          convert int to byte array of length c
static byte[] intToDelta(byte[] t)
          convert byte array to delta time a delta time is expressed as a byte array, length unknown (4 or less)
static int pow(int b, int e)
          compute b to the e power (b ** e)
static int stringToInt(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
See Also:
Constant Field Values
Constructor Detail

Utils

public Utils()
Method Detail

hexToBa

public static byte[] hexToBa(String h,
                             int len)
                      throws ProcessingException
convert hex string to byte array

Throws:
ProcessingException

baToString

public static String baToString(byte[] b,
                                int strt,
                                int end)
convert byte array to string (not hex)


baToHex

public static String baToHex(byte[] b,
                             int strt,
                             int end)
                      throws ProcessingException
convert byte array to hex string

Throws:
ProcessingException

intToBa

public static byte[] intToBa(int n,
                             int c)
                      throws ProcessingException
convert int to byte array of length c

Throws:
ProcessingException

baToInt

public static int baToInt(byte[] b,
                          int strt,
                          int end)
                   throws ProcessingException
convert byte array to int

Throws:
ProcessingException

getUnsignedByte

public static int getUnsignedByte(byte b)
convert byte (unsigned) to int


deltaToInt

public static ByteLen deltaToInt(byte[] b,
                                 int offset)
                          throws ProcessingException
convert delta time to byte array a delta time is expressed as a byte array, length unknown (4 or less)

Throws:
ProcessingException

pow

public static int pow(int b,
                      int e)
compute b to the e power (b ** e)


getPW

public static int getPW(byte[] dta,
                        int offset)
                 throws ProcessingException
Throws:
ProcessingException

getNextHiOrd

public static int getNextHiOrd(byte[] dta,
                               int offset)
                        throws ProcessingException
Throws:
ProcessingException

intToDelta

public static byte[] intToDelta(byte[] t)
                         throws ProcessingException
convert byte array to delta time a delta time is expressed as a byte array, length unknown (4 or less)

Throws:
ProcessingException

stringToInt

public static int stringToInt(String s)


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.