Tabnine Logo
Os.lseek
Code IndexAdd Tabnine to your IDE (free)

How to use
lseek
method
in
libcore.io.Os

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

origin: robovm/robovm

public long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException { return os.lseek(fd, offset, whence); }
public StructStat lstat(String path) throws ErrnoException { return os.lstat(path); }
origin: robovm/robovm

/**
 * Gets the current position within this file. All reads and
 * writes take place at the current file pointer position.
 *
 * @return the current offset in bytes from the beginning of the file.
 *
 * @throws IOException
 *             if an error occurs while getting the file pointer of this
 *             file.
 */
public long getFilePointer() throws IOException {
  try {
    return Libcore.os.lseek(fd, 0L, SEEK_CUR);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: robovm/robovm

  @Override
  public long skip(long byteCount) throws IOException {
    if (byteCount < 0) {
      throw new IOException("byteCount < 0: " + byteCount);
    }
    try {
      // Try lseek(2). That returns the new offset, but we'll throw an
      // exception if it couldn't perform exactly the seek we asked for.
      Libcore.os.lseek(fd, byteCount, SEEK_CUR);
      return byteCount;
    } catch (ErrnoException errnoException) {
      if (errnoException.errno == ESPIPE) {
        // You can't seek on a pipe, so fall back to the superclass' implementation.
        return super.skip(byteCount);
      }
      throw errnoException.rethrowAsIOException();
    }
  }
}
origin: robovm/robovm

/**
 * Moves this file's file pointer to a new position, from where following
 * {@code read}, {@code write} or {@code skip} operations are done. The
 * position may be greater than the current length of the file, but the
 * file's length will only change if the moving of the pointer is followed
 * by a {@code write} operation.
 *
 * @param offset
 *            the new file pointer position.
 * @throws IOException
 *             if this file is closed, {@code pos < 0} or another I/O error
 *             occurs.
 */
public void seek(long offset) throws IOException {
  if (offset < 0) {
    throw new IOException("offset < 0: " + offset);
  }
  try {
    Libcore.os.lseek(fd, offset, SEEK_SET);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: robovm/robovm

public FileChannel position(long newPosition) throws IOException {
  checkOpen();
  if (newPosition < 0) {
    throw new IllegalArgumentException("position: " + newPosition);
  }
  try {
    Libcore.os.lseek(fd, newPosition, SEEK_SET);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
  return this;
}
origin: robovm/robovm

public long position() throws IOException {
  checkOpen();
  try {
    return Libcore.os.lseek(fd, 0L, SEEK_CUR);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: ibinti/bugvm

public long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException { return os.lseek(fd, offset, whence); }
public StructStat lstat(String path) throws ErrnoException { return os.lstat(path); }
origin: MobiVM/robovm

public long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException { return os.lseek(fd, offset, whence); }
public StructStat lstat(String path) throws ErrnoException { return os.lstat(path); }
origin: ibinti/bugvm

public FileChannel position(long newPosition) throws IOException {
  checkOpen();
  if (newPosition < 0) {
    throw new IllegalArgumentException("position: " + newPosition);
  }
  try {
    Libcore.os.lseek(fd, newPosition, SEEK_SET);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
  return this;
}
origin: MobiVM/robovm

public FileChannel position(long newPosition) throws IOException {
  checkOpen();
  if (newPosition < 0) {
    throw new IllegalArgumentException("position: " + newPosition);
  }
  try {
    Libcore.os.lseek(fd, newPosition, SEEK_SET);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
  return this;
}
origin: com.bugvm/bugvm-rt

public FileChannel position(long newPosition) throws IOException {
  checkOpen();
  if (newPosition < 0) {
    throw new IllegalArgumentException("position: " + newPosition);
  }
  try {
    Libcore.os.lseek(fd, newPosition, SEEK_SET);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
  return this;
}
origin: com.mobidevelop.robovm/robovm-rt

public FileChannel position(long newPosition) throws IOException {
  checkOpen();
  if (newPosition < 0) {
    throw new IllegalArgumentException("position: " + newPosition);
  }
  try {
    Libcore.os.lseek(fd, newPosition, SEEK_SET);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
  return this;
}
origin: com.gluonhq/robovm-rt

public FileChannel position(long newPosition) throws IOException {
  checkOpen();
  if (newPosition < 0) {
    throw new IllegalArgumentException("position: " + newPosition);
  }
  try {
    Libcore.os.lseek(fd, newPosition, SEEK_SET);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
  return this;
}
origin: FlexoVM/flexovm

public FileChannel position(long newPosition) throws IOException {
  checkOpen();
  if (newPosition < 0) {
    throw new IllegalArgumentException("position: " + newPosition);
  }
  try {
    Libcore.os.lseek(fd, newPosition, SEEK_SET);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
  return this;
}
origin: ibinti/bugvm

public long position() throws IOException {
  checkOpen();
  try {
    return Libcore.os.lseek(fd, 0L, SEEK_CUR);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: MobiVM/robovm

public long position() throws IOException {
  checkOpen();
  try {
    return Libcore.os.lseek(fd, 0L, SEEK_CUR);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: com.bugvm/bugvm-rt

public long position() throws IOException {
  checkOpen();
  try {
    return Libcore.os.lseek(fd, 0L, SEEK_CUR);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: com.mobidevelop.robovm/robovm-rt

public long position() throws IOException {
  checkOpen();
  try {
    return Libcore.os.lseek(fd, 0L, SEEK_CUR);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: com.gluonhq/robovm-rt

public long position() throws IOException {
  checkOpen();
  try {
    return Libcore.os.lseek(fd, 0L, SEEK_CUR);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
origin: FlexoVM/flexovm

public long position() throws IOException {
  checkOpen();
  try {
    return Libcore.os.lseek(fd, 0L, SEEK_CUR);
  } catch (ErrnoException errnoException) {
    throw errnoException.rethrowAsIOException();
  }
}
libcore.ioOslseek

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

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • setScale (BigDecimal)
  • getContentResolver (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now