public enum OS extends Enum<OS>
| Modifier and Type | Class and Description |
|---|---|
static class |
OS.Unmapper |
| Modifier and Type | Method and Description |
|---|---|
static String |
getHostName() |
static long |
getPidMax() |
static int |
getProcessId() |
static String |
getTarget() |
static String |
getUserName() |
static boolean |
is64Bit() |
static boolean |
isLinux() |
static boolean |
isMacOSX() |
static boolean |
isWindows()
This may or may not be the OS thread id, but should be unique across processes
|
static long |
map(FileChannel fileChannel,
FileChannel.MapMode mode,
long start,
long size)
Map a region of a file into memory.
|
static long |
mapAlign(long offset)
Align an offset of a memory mapping in file based on OS.
|
static long |
mapAlignment()
Returns the alignment of offsets in file, from which memory mapping could start, based on
OS.
|
static Memory |
memory() |
static long |
pageAlign(long size)
Align the size to page boundary
|
static int |
pageSize() |
static long |
spaceUsed(String filename)
Get the sapce actually used by a file.
|
static void |
unmap(long address,
long size)
Unmap a region of memory.
|
static OS |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static OS[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final String TARGET
public static OS[] values()
for (OS c : OS.values()) System.out.println(c);
public static OS valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static String getHostName()
public static String getUserName()
public static String getTarget()
public static Memory memory()
public static long pageAlign(long size)
size - the size to alignpageSize()public static int pageSize()
pageAlign(long)public static long mapAlign(long offset)
offset - to alignmapAlignment()public static long mapAlignment()
mapAlign(long)public static boolean is64Bit()
public static int getProcessId()
public static boolean isWindows()
public static boolean isMacOSX()
public static boolean isLinux()
public static long getPidMax()
throws NumberFormatException
NumberFormatExceptionpublic static long map(FileChannel fileChannel, FileChannel.MapMode mode, long start, long size) throws IOException, IllegalArgumentException
fileChannel - to mapmode - of accessstart - offset within a filesize - of region to map.IOException - if the mapping failsIllegalArgumentException - if the arguments are not validpublic static void unmap(long address,
long size)
throws IOException
address - of the start of the mapping.size - of the region mapped.IOException - if the unmap fails.public static long spaceUsed(String filename)
filename - to get the actual size ofCopyright © 2016. All rights reserved.