@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();
    }
  }
{@link OutputStream} for writing to a {@link RegularFile}.

@author Colin Decker
jimfs/src/main/java/com/google/common/jimfs/JimfsOutputStream.java