jonelo.jacksum.util

Class Service


public class Service
extends java.lang.Object

Jacksum version 1.7.0 - checksum utility in Java Copyright (C) 2001-2006 Dipl.-Inf. (FH) Johann Nepomuk Loefflmann, All Rights Reserved, http://www.jonelo.de 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; either version 2 of the License, or (at your option) any later version. 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. E-mail: jonelo@jonelo.de

Method Summary

static String
decformat(long number, String mask)
static String
duration(long t)
Return a human readable String which represents a time in ms
static String
format(byte[] bytes)
static String
format(byte[] bytes, boolean uppercase)
static String
format(byte[] bytes, boolean uppercase, int group, char groupChar)
static String
formatAsBits(byte[] bytes)
static String
hexformat(long value, int nibbles)
static String
hexformat(long value, int nibbles, int group, char groupChar)
static boolean
isSymbolicLink(File file)
static String
right(long number, int blanks)
static void
setIntInByteArray(int i, byte[] b)
static void
setIntInByteArray(int i, byte[] b, int index)
Method transforms an int to 4 bytes and fills the array given in argument
static void
setLongInByteArray(long i, byte[] b)
Method transfers a long to 8 bytes and fills the array given in argument
static void
setLongInByteArray(long i, byte[] b, int index)
Method transfers a long to 8 bytes and fills the array given in argument

Method Details

decformat

public static String decformat(long number,
                               String mask)

duration

public static final String duration(long t)
Return a human readable String which represents a time in ms
Parameters:
t - a time in ms
Returns:
a human readable representation of time as String

format

public static String format(byte[] bytes)

format

public static String format(byte[] bytes,
                            boolean uppercase)

format

public static String format(byte[] bytes,
                            boolean uppercase,
                            int group,
                            char groupChar)

formatAsBits

public static String formatAsBits(byte[] bytes)

hexformat

public static String hexformat(long value,
                               int nibbles)

hexformat

public static String hexformat(long value,
                               int nibbles,
                               int group,
                               char groupChar)

isSymbolicLink

public static boolean isSymbolicLink(File file)

right

public static String right(long number,
                           int blanks)

setIntInByteArray

public static void setIntInByteArray(int i,
                                     byte[] b)
            throws IndexOutOfBoundsException

setIntInByteArray

public static void setIntInByteArray(int i,
                                     byte[] b,
                                     int index)
            throws IndexOutOfBoundsException
Method transforms an int to 4 bytes and fills the array given in argument
Parameters:
i - a int value
b - the byte array
index - the index in the array

setLongInByteArray

public static void setLongInByteArray(long i,
                                      byte[] b)
            throws IndexOutOfBoundsException
Method transfers a long to 8 bytes and fills the array given in argument
Parameters:
i - a long value
b - the byte array

setLongInByteArray

public static void setLongInByteArray(long i,
                                      byte[] b,
                                      int index)
            throws IndexOutOfBoundsException
Method transfers a long to 8 bytes and fills the array given in argument
Parameters:
i - a long value
b - the byte array
index - the index in the array