public enum OS extends Enum<OS>
Modifier and Type | Class and Description |
---|---|
static class |
OS.Unmapper |
Modifier and Type | Field and Description |
---|---|
static String |
TARGET
Deprecated.
|
static Exception |
TIME_LIMIT |
static String |
TMP |
static String |
USER_DIR |
static String |
USER_HOME |
Modifier and Type | Method and Description |
---|---|
static String |
findDir(String suffix) |
static File |
findFile(String... path)
Search a list of directories to find a path which is the last element.
|
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 |
memoryMapped() |
static long |
pageAlign(long size)
Align the size to page boundary
|
static int |
pageSize() |
static int |
read0(FileDescriptor fd,
long address,
int len) |
static long |
spaceUsed(String filename)
Get the space actually used by a file.
|
static void |
unmap(long address,
long size)
Unmap a region of memory.
|
static String |
userDir() |
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.
|
static int |
write0(FileDescriptor fd,
long address,
int len) |
public static final String TMP
public static final String USER_DIR
public static final String USER_HOME
public static final Exception TIME_LIMIT
@Deprecated 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 null@NotNull public static String findDir(@NotNull String suffix) throws FileNotFoundException
FileNotFoundException
@NotNull public static File findFile(@NotNull String... path)
path
- of directories to use if found, the last path is always appended.public static String getHostName()
public static String getUserName()
public static String getTarget()
@NotNull 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
NumberFormatException
public static long map(@NotNull 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 memoryMapped()
public static long spaceUsed(@NotNull String filename)
filename
- to get the actual size ofpublic static String userDir()
public static int read0(FileDescriptor fd, long address, int len) throws IOException
IOException
public static int write0(FileDescriptor fd, long address, int len) throws IOException
IOException
Copyright © 2020. All rights reserved.