Writes the pollfd entry from the source wrapper at the source index
over the entry in the target wrapper at the target index. The source
array remains unchanged unless the source array and the target are
the same array.
332623
static void replaceEntry(PollArrayWrapper source, int sindex,
                      PollArrayWrapper target, int tindex) {
        target.putDescriptor(tindex, source.getDescriptor(sindex));
        target.putEventOps(tindex, source.getEventOps(sindex));
        target.putReventOps(tindex, source.getReventOps(sindex));
    }
904394
@Override
    public void write(final T value, boolean incomplete)
    {
        //  Place the value to the queue, add new terminator element.
        queue.push(value);

        //  Move the "flush up to here" pointer.
        if (!incomplete) {
            f = queue.backPos();
        }
    }
1135595
private void writeObject(java.io.ObjectOutputStream out)
                    throws IOException
    {
        out.defaultWriteObject();
        out.write(frciEyecatcher);
        out.writeShort(frciPlatform);
        out.writeShort(frciVersionID);
    }
1056196
@Override
  void write(ByteCodeWriter out)
    throws IOException
  {
    out.write(ConstantPool.CP_METHODHANDLE);
    out.write(_type.getCode());
    out.writeShort(_entry.getIndex());
  }
1097896
@Override
    public void write(int b) throws IOException {
        Exceptions.checkNotClosed(this.closed, this);
        Preconditions.checkState(this.currentFrame != null, "No current frame exists. Most likely no record is started.");

        int attemptCount = 0;
        int totalBytesWritten = 0;
        while (totalBytesWritten == 0 && attemptCount < 2) {
            // We attempt to write 1 byte. If append() says it wrote 0 bytes, it means the current frame is full. Seal it and create a new one.
            totalBytesWritten += this.currentFrame.append((byte) b);
            if (totalBytesWritten == 0) {
                this.currentFrame.endEntry(false); // Close the current entry, and indicate it is not the last one of the record.
                flush();
                createNewFrame();
                startNewRecordInCurrentFrame(false);
            }

            attemptCount++;
        }

        if (totalBytesWritten == 0) {
            throw new SerializationException("Unable to make progress in serializing to DataFrame.");
        }
    }
870257
private void fsyncImpl(Result<Boolean> result, FsyncType fsyncType)
  {
    try {
      flushData();
      
      ArrayList<SegmentFsyncCallback> fsyncListeners
        = new ArrayList<>(_fsyncListeners);
      _fsyncListeners.clear();
      
      Result<Boolean> resultNext = result.then((v,r)->
        afterDataFsync(r, _position, fsyncType, fsyncListeners));
        
      if (_isDirty || ! fsyncType.isSchedule()) {
        _isDirty = false;
      
        try (OutStore sOut = _readWrite.openWrite(_segment.extent())) {
          if (fsyncType.isSchedule()) {
            sOut.fsyncSchedule(resultNext);
          }
          else {
            sOut.fsync(resultNext);
          }
        }
      }
      else {
        resultNext.ok(true);
      }
    } catch (Throwable e) {
      e.printStackTrace();
      result.fail(e);
    }
  }
317730
@Override
    protected void write(EncodingState encodingState, char[] b, int off, int len) throws IOException {
        target.write(b, off, len);
    }
1010439
public void write(long pos, Buffer source, long byteCount) throws IOException {
    if (byteCount < 0 || byteCount > source.size()) throw new IndexOutOfBoundsException();

    while (byteCount > 0L) {
      long bytesWritten = fileChannel.transferFrom(source, pos, byteCount);
      pos += bytesWritten;
      byteCount -= bytesWritten;
    }
  }
981822
private void writeBuffer() throws IOException {
        bufferedWriter.flip(); // position is set to zero in dataFile.write
        dataFile.write(writeOffset, bufferedWriter);
        writeOffset += bufferedWriter.limit();
        bufferedWriter.clear();
        readNextChunkFromFile(); // before overwriting the next bucket. Read it.
    }
132130
private void writeEntry(HashtableEntry entry)

    throws IOException, EOFException, FileManagerException, ClassNotFoundException {

        long index = getHtindex(entry.index, entry.tableid);
        if (index == 0) { // first one in this bucket
            updateEntry(entry); // write to disk
            writeHashIndex(entry.index, entry.location, entry.tableid); // update index
        } else if (index == entry.location) { // replacing first entry
            updateEntry(entry);
            writeHashIndex(entry.index, entry.location, entry.tableid); // update index
        } else { // 
            //
            // If the entry has a "previous" pointer, then it was read earlier
            // from disk.  Otherwise, it is a brand new entry.  If it is a brand
            // entry, we write it to disk and chain at the front of the bucket.
            // If "previous" is not zero, we check to see if reallocation is
            // needed (location == 0).  If not, we simply update on disk and we're
            // done.  If reallocation is needed we update on disk to do the allocation
            // and call updatePointer to chain into the bucket.
            //
            if (entry.previous == 0) {
                entry.next = index;
                updateEntry(entry);
                writeHashIndex(entry.index, entry.location, entry.tableid); // update index
            } else {
                if (entry.location == 0) { // allocation needed?
                    updateEntry(entry); // do allocation
                    updatePointer(entry.previous, entry.location); // chain in
                } else {
                    updateEntry(entry); // no allocation, just update fields
                }
            }
        }

    }
1053510
protected void writeEntry(final GZIPArchive.Entry entry) throws IOException {

		// ID1 ID2 CM FLG

		this.output.write(GZIPArchive.GZIP_START);

		// MTIME

		writeLEInt(this.output, entry.mtime);

		// XFL OS

		this.output.write(GZIPArchive.XFL_OS);

		/* EXTRA begin */

		// XLEN

		writeLEShort(this.output, GZIPArchive.XLEN);

		// SI1 SI2 (as in warc spec)

		this.output.write(GZIPArchive.SKIP_LEN);

		// LEN

		writeLEShort(this.output, GZIPArchive.SUB_LEN);

		// compressed-skip-length (as in warc spec)

		writeLEInt(this.output, entry.compressedSkipLength);

		// uncompressed length (as in warc spec)

		writeLEInt(this.output, entry.uncompressedSkipLength);

		/* EXTRA end */

		// NAME

		this.output.write(entry.name);
		this.output.write(0);

		// COMMENT

		this.output.write(entry.comment);
		this.output.write(0);

		// compressed blocks

		this.output.write(deflaterStream.array, 0, deflaterStream.length);

		// CRC32

		writeLEInt(this.output, entry.crc32);

		// ISIZE

		writeLEInt(this.output, entry.uncompressedSkipLength);

	}
67238
private void writeObject(java.io.ObjectOutputStream out)
                    throws IOException
    {
        out.defaultWriteObject();
        // write out the header information
        out.write(eyecatcher);
        out.writeShort(platform);
        out.writeShort(versionID);

        // write out the data
        out.writeObject(server);
        out.writeObject(allWrappers);
        out.writeInt(chunkSize);
    }
587131
@Override
    public void write(byte[] b, int offset, int length) throws IOException {
        if (length == 0) {
            return;
        }
        int newcount = count + length;
        if (newcount > buf.length) {
            buf = Arrays.copyOf(buf, oversize(newcount));
        }
        System.arraycopy(b, offset, buf, count, length);
        count = newcount;
    }
787661
public void write(Object from, File target) throws IOException {
    OutputStream outputStream = new FileOutputStream(target);
    try {
      write(from, outputStream);
    } finally {
      outputStream.close();
    }
  }
312106
@Override
    public WRITE_ACTION writeOrAddToQ(H2WriteQEntry entry) throws FlowControlException {
        synchronized (qSync) {

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "process write entry with qStatus: " + qStatus + " entry: " + entry.hashCode());
            }
            if (entry.getFrameType() == FrameTypes.DATA) {
                decreaseConnectionWindowUpdateWriteLimit(entry.getPayloadLength());
            }

            if (qStatus == Q_STATUS.NOT_IN_USE) {
                // perform the write on this thread, outside the sync block
                qStatus = Q_STATUS.BYPASSED;
                entry.setServicedOnQ(false);

            } else if ((qStatus == Q_STATUS.ACTIVE) || (qStatus == Q_STATUS.STAND_BY)) {
                // queue is in use, so add this write entry to the queue/tree and leave
                entry.setServicedOnQ(true);
                addEntryToQ(entry);
                return WRITE_ACTION.QUEUED;

            } else if (qStatus == Q_STATUS.BYPASSED) {
                // queue is not in use, but needs to be now, since we are want to write with a write outstanding.
                entry.setServicedOnQ(true);
                qStatus = Q_STATUS.STAND_BY;
                addEntryToQ(entry);
                // wait for outstanding request to complete before allowing the queue thread to make more write requests
                try {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "waiting to start write Q thread");
                    }
                    qSync.wait();
                    qStatus = Q_STATUS.ACTIVE;
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "start write Q thread");
                    }
                    startQThread();
                    return WRITE_ACTION.QUEUED;
                } catch (InterruptedException e) {
                    // TODO: handle this somehow
                }

            } else if ((qStatus == Q_STATUS.QUIT) || (qStatus == Q_STATUS.FINISHED)) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "do not process write - Q told to quit");
                }
                return WRITE_ACTION.CONNECTION_QUIT;
            }
        } // end synchronized

        // Determined from above that we are to handle this write on the callers thread
        if (!(entry.getServicedOnQ())) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "perform write on caller's thread");
            }
            return writeEntry(entry);
        }

        // should never get here
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "uh-oh we're confused: WRITE_ACTION.CONFUSED");
        }
        return WRITE_ACTION.CONFUSED;
    }
92907
void linkEntry(FatLfnDirectoryEntry entry) throws IOException {
        checkUniqueName(entry.getName());

        final ShortName sn = makeShortName(entry.getName());
        entry.realEntry.setShortName(sn);
        
        this.longNameIndex.put(entry.getName().toLowerCase(Locale.ROOT), entry);
        this.shortNameIndex.put(entry.realEntry.getShortName(), entry);
        
        updateLFN();
    }
504413
@Override
	public void write(final DataOutput out) throws IOException {
		out.writeInt(this.map.size());
		for (final Entry<K, V> entry : this.map.entrySet()) {
			entry.getKey().write(out);
			entry.getValue().write(out);
		}
	}