|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.openstego.util.CommonUtil
Common utilities for OpenStego
| Method Summary | |
static int |
byteToInt(int b)
Byte to Int converter |
static int |
ceilingHalf(int num)
Returns the ceiling of the half of the input value |
static int |
floorHalf(int num)
Returns the floor of the half of the input value |
static byte[] |
getFileBytes(File file)
Method to get byte array data from given file |
static byte[] |
getStreamBytes(InputStream is)
Method to get byte array data from given InputStream |
static double |
max(double x,
double y)
Get maximum of two given values |
static int |
max(int x,
int y)
Get maximum of two given values |
static double |
min(double x,
double y)
Get minimum of two given values |
static int |
min(int x,
int y)
Get minimum of two given values |
static int |
mod(int num,
int div)
Returns the modulus of the input value (taking care of the sign of the value) |
static List |
parseFileList(String fileList,
String delimiter)
Method to parse a delimiter separated list of files into arraylist of filenames. |
static void |
setEnabled(JTextField textField,
boolean enabled)
Method to enable/disable a Swing JTextField object |
static void |
writeFile(byte[] fileData,
File file)
Method to write file data to disk |
static void |
writeFile(byte[] fileData,
String fileName)
Method to write file data to disk |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static byte[] getStreamBytes(InputStream is)
throws OpenStegoException
is - InputStream to read
OpenStegoException
public static byte[] getFileBytes(File file)
throws OpenStegoException
file - File to read
OpenStegoException
public static void writeFile(byte[] fileData,
String fileName)
throws OpenStegoException
fileData - File datafileName - File name (If this is null, then data is written to stdout)
OpenStegoException
public static void writeFile(byte[] fileData,
File file)
throws OpenStegoException
fileData - File datafile - File object (If this is null, then data is written to stdout)
OpenStegoException
public static void setEnabled(JTextField textField,
boolean enabled)
textField - Swing JTextField objectenabled - Flag to indicate whether to enable or disable the object
public static List parseFileList(String fileList,
String delimiter)
fileList - Delimiter separated list of filenamesdelimiter - Delimiter for tokenization
public static int byteToInt(int b)
b - Input byte value
public static int floorHalf(int num)
num - Input number
public static int ceilingHalf(int num)
num - Input number
public static int mod(int num,
int div)
num - Input numberdiv - Divisor for modulus
public static int max(int x,
int y)
x - Value 1y - value 2
public static double max(double x,
double y)
x - Value 1y - value 2
public static int min(int x,
int y)
x - Value 1y - value 2
public static double min(double x,
double y)
x - Value 1y - value 2
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||