@Override
  public synchronized void write(int b) throws IOException {
    checkNotClosed();

    file.writeLock().lock();
    try {
      if (append) {
        pos = file.sizeWithoutLocking();
      }
      file.write(pos++, (byte) b);

      file.setLastModifiedTime(fileSystemState.now());
    } finally {
      file.writeLock().unlock();
    }
  }
@Test
  public void testWrite_partialArray() throws IOException {
    JimfsOutputStream out = newOutputStream(false);
    out.write(new byte[] {1, 2, 3, 4, 5, 6}, 1, 3);
    assertStoreContains(out, 2, 3, 4);
  }