@Override public Selector wakeup() { try { Libcore.os.write(wakeupOut, new byte[] { 1 }, 0, 1); } catch (ErrnoException ignored) { } return this; }
public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException { return os.write(fd, buffer); } public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException { return os.write(fd, bytes, byteOffset, byteCount); }
public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException { return os.write(fd, bytes, byteOffset, byteCount); } public int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException { return os.writev(fd, buffers, offsets, byteCounts); }
@Override public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException { BlockGuard.getThreadPolicy().onWriteToDisk(); return os.write(fd, buffer); }
@Override public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException { BlockGuard.getThreadPolicy().onWriteToDisk(); return os.write(fd, bytes, byteOffset, byteCount); }
/** * java.io always writes every byte it's asked to, or fails with an error. (That is, unlike * Unix it never just writes as many bytes as happens to be convenient.) */ public static void write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws IOException { Arrays.checkOffsetAndCount(bytes.length, byteOffset, byteCount); if (byteCount == 0) { return; } try { while (byteCount > 0) { int bytesWritten = Libcore.os.write(fd, bytes, byteOffset, byteCount); byteCount -= bytesWritten; byteOffset += bytesWritten; } } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
try { if (position == -1) { bytesWritten = Libcore.os.write(fd, buffer); } else { bytesWritten = Libcore.os.pwrite(fd, buffer, position);
@Override public Selector wakeup() { try { Libcore.os.write(wakeupOut, new byte[] { 1 }, 0, 1); } catch (ErrnoException ignored) { } return this; }
@Override public Selector wakeup() { try { Libcore.os.write(wakeupOut, new byte[] { 1 }, 0, 1); } catch (ErrnoException ignored) { } return this; }
@Override public Selector wakeup() { try { Libcore.os.write(wakeupOut, new byte[] { 1 }, 0, 1); } catch (ErrnoException ignored) { } return this; }
@Override public Selector wakeup() { try { Libcore.os.write(wakeupOut, new byte[] { 1 }, 0, 1); } catch (ErrnoException ignored) { } return this; }
@Override public Selector wakeup() { try { Libcore.os.write(wakeupOut, new byte[] { 1 }, 0, 1); } catch (ErrnoException ignored) { } return this; }
@Override public Selector wakeup() { try { Libcore.os.write(wakeupOut, new byte[] { 1 }, 0, 1); } catch (ErrnoException ignored) { } return this; }
@Override public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException { BlockGuard.getThreadPolicy().onWriteToDisk(); return os.write(fd, bytes, byteOffset, byteCount); }
@Override public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException { BlockGuard.getThreadPolicy().onWriteToDisk(); return os.write(fd, buffer); }
@Override public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException { BlockGuard.getThreadPolicy().onWriteToDisk(); return os.write(fd, buffer); }
@Override public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException { BlockGuard.getThreadPolicy().onWriteToDisk(); return os.write(fd, bytes, byteOffset, byteCount); }
@Override public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException { BlockGuard.getThreadPolicy().onWriteToDisk(); return os.write(fd, bytes, byteOffset, byteCount); }
@Override public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException { BlockGuard.getThreadPolicy().onWriteToDisk(); return os.write(fd, buffer); }
@Override public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException { BlockGuard.getThreadPolicy().onWriteToDisk(); return os.write(fd, bytes, byteOffset, byteCount); }