|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.claudio.iax2.Util
public final class Util
Copyright (C) 2006 Claudio Nieder <private@claudio.ch>, CH-8610 Uster
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static java.lang.String |
getString(byte[] buffer,
int offset,
int length)
Read the requested number of byte from the buffer and return it interpreted an utf-8 encoded string. |
static int |
getUnsigned16(byte[] buffer,
int offset)
Read two byte from the buffer and return it interpreted as a big endian unsigned value. |
static long |
getUnsigned32(byte[] buffer,
int offset)
Read four byte from the buffer and return it interpreted as a big endian unsigned value. |
static int |
getUnsigned8(byte[] buffer,
int offset)
Read a byte from the buffer and return its unsigned value. |
static void |
main(java.lang.String[] args)
Print license. |
static java.lang.String |
md5(java.lang.String text)
Compute an md5 checksum interpreting the text as utf-8 encoded. |
static int |
putString(byte[] buffer,
int offset,
java.lang.String value)
Put a string into the buffer using utf-8 encoding. |
static void |
putUnsigned16(byte[] buffer,
int offset,
int word)
Put an unsinged value within the range 0..65536 into a byte array in big endian manner. |
static void |
putUnsigned32(byte[] buffer,
int offset,
long word)
Put an unsinged value within the range 0..4294967296 into a byte array in big endian matter. |
static void |
putUnsigned8(byte[] buffer,
int offset,
int word)
Put an unsinged value within the range 0..255 into a byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static final java.lang.String md5(java.lang.String text)
text
- String for which md5 sum is to be computed
public static final void putUnsigned8(byte[] buffer, int offset, int word)
buffer
- byte arrayoffset
- where to put the valueword
- value to storepublic static final void putUnsigned16(byte[] buffer, int offset, int word)
buffer
- byte arrayoffset
- start position to which the value is writtenword
- value to storepublic static final void putUnsigned32(byte[] buffer, int offset, long word)
buffer
- byte arrayoffset
- where to put the valueword
- value to storepublic static final int getUnsigned8(byte[] buffer, int offset)
buffer
- byte arrayoffset
- where to read the value
public static final int getUnsigned16(byte[] buffer, int offset)
buffer
- byte arrayoffset
- where to read the value
public static final long getUnsigned32(byte[] buffer, int offset)
buffer
- byte arrayoffset
- where to read the value
public static final java.lang.String getString(byte[] buffer, int offset, int length)
Note: This method terminates the JVM (System.exit(1)) if utf-8 encoding is not supported.
buffer
- byte arrayoffset
- where to read the valuelength
- number of byte to read
public static final int putString(byte[] buffer, int offset, java.lang.String value)
Note: This method terminates the JVM (System.exit(1)) if utf-8 encoding is not supported.
buffer
- byte arrayoffset
- where to read the valuevalue
- String to insert
public static final void main(java.lang.String[] args)
args
- ignored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |