Codota Logo
Os.mmap
Code IndexAdd Codota to your IDE (free)

How to use
mmap
method
in
libcore.io.Os

Best Java code snippets using libcore.io.Os.mmap (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: robovm/robovm

public long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException { return os.mmap(address, byteCount, prot, flags, fd, offset); }
public void msync(long address, long byteCount, int flags) throws ErrnoException { os.msync(address, byteCount, flags); }
origin: robovm/robovm

public static MemoryBlock mmap(FileDescriptor fd, long offset, long size, MapMode mapMode) throws IOException {
  if (size == 0) {
    // You can't mmap(2) a zero-length region, but Java allows it.
    return new MemoryBlock(0, 0);
  }
  // Check just those errors mmap(2) won't detect.
  if (offset < 0 || size < 0 || offset > Integer.MAX_VALUE || size > Integer.MAX_VALUE) {
    throw new IllegalArgumentException("offset=" + offset + " size=" + size);
  }
  int prot;
  int flags;
  if (mapMode == MapMode.PRIVATE) {
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_PRIVATE;
  } else if (mapMode == MapMode.READ_ONLY) {
    prot = PROT_READ;
    flags = MAP_SHARED;
  } else { // mapMode == MapMode.READ_WRITE
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_SHARED;
  }
  try {
    long address = Libcore.os.mmap(0L, size, prot, flags, fd, offset);
    return new MemoryMappedBlock(address, size);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: robovm/robovm

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: MobiVM/robovm

public long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException { return os.mmap(address, byteCount, prot, flags, fd, offset); }
public void msync(long address, long byteCount, int flags) throws ErrnoException { os.msync(address, byteCount, flags); }
origin: ibinti/bugvm

public long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException { return os.mmap(address, byteCount, prot, flags, fd, offset); }
public void msync(long address, long byteCount, int flags) throws ErrnoException { os.msync(address, byteCount, flags); }
origin: com.mobidevelop.robovm/robovm-rt

public long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException { return os.mmap(address, byteCount, prot, flags, fd, offset); }
public void msync(long address, long byteCount, int flags) throws ErrnoException { os.msync(address, byteCount, flags); }
origin: com.bugvm/bugvm-rt

public long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException { return os.mmap(address, byteCount, prot, flags, fd, offset); }
public void msync(long address, long byteCount, int flags) throws ErrnoException { os.msync(address, byteCount, flags); }
origin: com.gluonhq/robovm-rt

public long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException { return os.mmap(address, byteCount, prot, flags, fd, offset); }
public void msync(long address, long byteCount, int flags) throws ErrnoException { os.msync(address, byteCount, flags); }
origin: FlexoVM/flexovm

public long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException { return os.mmap(address, byteCount, prot, flags, fd, offset); }
public void msync(long address, long byteCount, int flags) throws ErrnoException { os.msync(address, byteCount, flags); }
origin: ibinti/bugvm

public static MemoryBlock mmap(FileDescriptor fd, long offset, long size, MapMode mapMode) throws IOException {
  if (size == 0) {
    // You can't mmap(2) a zero-length region, but Java allows it.
    return new MemoryBlock(0, 0);
  }
  // Check just those errors mmap(2) won't detect.
  if (offset < 0 || size < 0 || offset > Integer.MAX_VALUE || size > Integer.MAX_VALUE) {
    throw new IllegalArgumentException("offset=" + offset + " size=" + size);
  }
  int prot;
  int flags;
  if (mapMode == MapMode.PRIVATE) {
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_PRIVATE;
  } else if (mapMode == MapMode.READ_ONLY) {
    prot = PROT_READ;
    flags = MAP_SHARED;
  } else { // mapMode == MapMode.READ_WRITE
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_SHARED;
  }
  try {
    long address = Libcore.os.mmap(0L, size, prot, flags, fd, offset);
    return new MemoryMappedBlock(address, size);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: MobiVM/robovm

public static MemoryBlock mmap(FileDescriptor fd, long offset, long size, MapMode mapMode) throws IOException {
  if (size == 0) {
    // You can't mmap(2) a zero-length region, but Java allows it.
    return new MemoryBlock(0, 0);
  }
  // Check just those errors mmap(2) won't detect.
  if (offset < 0 || size < 0 || offset > Integer.MAX_VALUE || size > Integer.MAX_VALUE) {
    throw new IllegalArgumentException("offset=" + offset + " size=" + size);
  }
  int prot;
  int flags;
  if (mapMode == MapMode.PRIVATE) {
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_PRIVATE;
  } else if (mapMode == MapMode.READ_ONLY) {
    prot = PROT_READ;
    flags = MAP_SHARED;
  } else { // mapMode == MapMode.READ_WRITE
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_SHARED;
  }
  try {
    long address = Libcore.os.mmap(0L, size, prot, flags, fd, offset);
    return new MemoryMappedBlock(address, size);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: MobiVM/robovm

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: com.mobidevelop.robovm/robovm-rt

public static MemoryBlock mmap(FileDescriptor fd, long offset, long size, MapMode mapMode) throws IOException {
  if (size == 0) {
    // You can't mmap(2) a zero-length region, but Java allows it.
    return new MemoryBlock(0, 0);
  }
  // Check just those errors mmap(2) won't detect.
  if (offset < 0 || size < 0 || offset > Integer.MAX_VALUE || size > Integer.MAX_VALUE) {
    throw new IllegalArgumentException("offset=" + offset + " size=" + size);
  }
  int prot;
  int flags;
  if (mapMode == MapMode.PRIVATE) {
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_PRIVATE;
  } else if (mapMode == MapMode.READ_ONLY) {
    prot = PROT_READ;
    flags = MAP_SHARED;
  } else { // mapMode == MapMode.READ_WRITE
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_SHARED;
  }
  try {
    long address = Libcore.os.mmap(0L, size, prot, flags, fd, offset);
    return new MemoryMappedBlock(address, size);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: com.gluonhq/robovm-rt

public static MemoryBlock mmap(FileDescriptor fd, long offset, long size, MapMode mapMode) throws IOException {
  if (size == 0) {
    // You can't mmap(2) a zero-length region, but Java allows it.
    return new MemoryBlock(0, 0);
  }
  // Check just those errors mmap(2) won't detect.
  if (offset < 0 || size < 0 || offset > Integer.MAX_VALUE || size > Integer.MAX_VALUE) {
    throw new IllegalArgumentException("offset=" + offset + " size=" + size);
  }
  int prot;
  int flags;
  if (mapMode == MapMode.PRIVATE) {
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_PRIVATE;
  } else if (mapMode == MapMode.READ_ONLY) {
    prot = PROT_READ;
    flags = MAP_SHARED;
  } else { // mapMode == MapMode.READ_WRITE
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_SHARED;
  }
  try {
    long address = Libcore.os.mmap(0L, size, prot, flags, fd, offset);
    return new MemoryMappedBlock(address, size);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: com.bugvm/bugvm-rt

public static MemoryBlock mmap(FileDescriptor fd, long offset, long size, MapMode mapMode) throws IOException {
  if (size == 0) {
    // You can't mmap(2) a zero-length region, but Java allows it.
    return new MemoryBlock(0, 0);
  }
  // Check just those errors mmap(2) won't detect.
  if (offset < 0 || size < 0 || offset > Integer.MAX_VALUE || size > Integer.MAX_VALUE) {
    throw new IllegalArgumentException("offset=" + offset + " size=" + size);
  }
  int prot;
  int flags;
  if (mapMode == MapMode.PRIVATE) {
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_PRIVATE;
  } else if (mapMode == MapMode.READ_ONLY) {
    prot = PROT_READ;
    flags = MAP_SHARED;
  } else { // mapMode == MapMode.READ_WRITE
    prot = PROT_READ|PROT_WRITE;
    flags = MAP_SHARED;
  }
  try {
    long address = Libcore.os.mmap(0L, size, prot, flags, fd, offset);
    return new MemoryMappedBlock(address, size);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: FlexoVM/flexovm

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: com.gluonhq/robovm-rt

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: ibinti/bugvm

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: com.bugvm/bugvm-rt

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
libcore.ioOsmmap

Popular methods of Os

  • accept
  • access
  • bind
  • chmod
  • chown
  • close
  • connect
  • dup
  • dup2
  • environ
  • execv
  • execve
  • execv,
  • execve,
  • fchmod,
  • fchown,
  • fcntlFlock,
  • fcntlLong,
  • fcntlVoid,
  • fdatasync,
  • fstat,
  • fstatvfs

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now