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); }
/** * 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(); } }
@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(); } } }
/** * 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(); } }
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; }
public long position() throws IOException { checkOpen(); try { return Libcore.os.lseek(fd, 0L, SEEK_CUR); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
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); }
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); }
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; }
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; }
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; }
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; }
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; }
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; }
public long position() throws IOException { checkOpen(); try { return Libcore.os.lseek(fd, 0L, SEEK_CUR); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
public long position() throws IOException { checkOpen(); try { return Libcore.os.lseek(fd, 0L, SEEK_CUR); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
public long position() throws IOException { checkOpen(); try { return Libcore.os.lseek(fd, 0L, SEEK_CUR); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
public long position() throws IOException { checkOpen(); try { return Libcore.os.lseek(fd, 0L, SEEK_CUR); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
public long position() throws IOException { checkOpen(); try { return Libcore.os.lseek(fd, 0L, SEEK_CUR); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
public long position() throws IOException { checkOpen(); try { return Libcore.os.lseek(fd, 0L, SEEK_CUR); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }