code: public boolean lock(boolean shared, boolean block)
    {
      if (shared && !_canRead) {
        // Invalid request for a shared "read" lock on a write only stream.
  
        return false;
      }
  
      if (!shared && !_canWrite) {
        // Invalid request for an exclusive "write" lock on a read only stream.
  
        return false;
      }
  
      return true;
    }
docs: Implement LockableStream as a no-op, but maintain
  compatibility with FileWriteStream and FileReadStream
  wrt returning false to indicate error case.