public class Utility extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
byteArrayDelete(byte[] src,
int offset,
int len)
Return a copy of a source byte array with a region deleted.
|
static byte[] |
byteArrayInsert(byte[] src,
int offset,
byte[] insert,
int insertOffset,
int insertLen)
Return a copy of a source byte array with a region inserted.
|
static byte[] |
byteArrayReplace(byte[] src,
int offset,
int len,
byte[] insert,
int insertOffset,
int insertLen)
Return a copy of a source byte array with a region replaced.
|
static void |
centerWindow(Window window)
Request a window to be centered on the display screen.
|
static Frame |
getFrame(Component component)
Get the parent frame of a component.
|
static String |
getJavaVersion()
Get the Java version.
|
static String |
getOSName()
Get the operating system name.
|
static String |
getOSVersion()
Get the operating system version.
|
public static String getOSName()
public static String getOSVersion()
public static String getJavaVersion()
public static byte[] byteArrayDelete(byte[] src, int offset, int len)
src
- the source array to copyoffset
- the offset of the region to deletelen
- the length in bytes of the region to deletepublic static byte[] byteArrayInsert(byte[] src, int offset, byte[] insert, int insertOffset, int insertLen)
src
- the source array to copyoffset
- the offset of the region to insertinsert
- the array to insert a region ofinsertOffset
- the offset of the region to insertinsertLen
- the length in bytes of the region to insertpublic static byte[] byteArrayReplace(byte[] src, int offset, int len, byte[] insert, int insertOffset, int insertLen)
src
- the source array to copyoffset
- the offset of the region to replacelen
- the length of the region to replaceinsert
- the array to insert a region ofinsertOffset
- the offset of the region to insertinsertLen
- the length in bytes of the region to insertpublic static Frame getFrame(Component component)
Frame
class, the parent frame, or null if
the component is not an instance of the Frame
class and does
not have a parent frame.component
- the component to get the parent frame ofpublic static void centerWindow(Window window)
window
- the window to request be centered on the display screenCopyright © 2014. All Rights Reserved.