public class CommonUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
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(java.io.File file)
Method to get byte array data from given file
|
static byte[] |
getStreamBytes(java.io.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 java.util.List<java.io.File> |
parseFileList(java.lang.String fileList,
java.lang.String delimiter)
Method to parse a delimiter separated list of files into arraylist of filenames.
|
static void |
setEnabled(javax.swing.JTextField textField,
boolean enabled)
Method to enable/disable a Swing JTextField object
|
static void |
writeFile(byte[] fileData,
java.io.File file)
Method to write file data to disk
|
static void |
writeFile(byte[] fileData,
java.lang.String fileName)
Method to write file data to disk
|
public static byte[] getStreamBytes(java.io.InputStream is)
throws OpenStegoException
is - InputStream to readOpenStegoExceptionpublic static byte[] getFileBytes(java.io.File file)
throws OpenStegoException
file - File to readOpenStegoExceptionpublic static void writeFile(byte[] fileData,
java.lang.String fileName)
throws OpenStegoException
fileData - File datafileName - File name (If this is null, then data is written to stdout)OpenStegoExceptionpublic static void writeFile(byte[] fileData,
java.io.File file)
throws OpenStegoException
fileData - File datafile - File object (If this is null, then data is written to stdout)OpenStegoExceptionpublic static void setEnabled(javax.swing.JTextField textField,
boolean enabled)
textField - Swing JTextField objectenabled - Flag to indicate whether to enable or disable the objectpublic static java.util.List<java.io.File> parseFileList(java.lang.String fileList,
java.lang.String delimiter)
fileList - Delimiter separated list of filenamesdelimiter - Delimiter for tokenizationpublic static int byteToInt(int b)
b - Input byte valuepublic static int floorHalf(int num)
num - Input numberpublic static int ceilingHalf(int num)
num - Input numberpublic static int mod(int num,
int div)
num - Input numberdiv - Divisor for moduluspublic static int max(int x,
int y)
x - Value 1y - value 2public static double max(double x,
double y)
x - Value 1y - value 2public static int min(int x,
int y)
x - Value 1y - value 2public static double min(double x,
double y)
x - Value 1y - value 2Copyright © 2007-2021 Samir Vaidya. All Rights Reserved.