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

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • getContentResolver (Context)
  • setScale (BigDecimal)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Permission (java.security)
    Legacy security code; do not use.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Join (org.hibernate.mapping)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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