Writes a full output stream.
960134
@Override
    public void writeByteStream(InputStream is)
        throws IOException
    {
        while (true) {
            int len = SIZE - _offset - 3;

            if (len < 16) {
                flushBuffer();
                len = SIZE - _offset - 3;
            }

            len = is.read(_buffer, _offset + 3, len);

            if (len <= 0) {
                _buffer[_offset++] = BC_BINARY_DIRECT;
                return;
            }

            _buffer[_offset + 0] = (byte) BC_BINARY_CHUNK;
            _buffer[_offset + 1] = (byte) (len >> 8);
            _buffer[_offset + 2] = (byte) (len);

            _offset += len + 3;
        }
    }
1020625
public void write(OutputStream stream) throws IOException {
        //Creating buffer
        ByteArrayOutputStream bos = new ByteArrayOutputStream();

        //Creating compressed output data stream
        DeflaterOutputStream deflate = new DeflaterOutputStream(bos);
        DataOutputStream dataStream = new DataOutputStream(deflate);

        //Writing index step
        dataStream.writeLong(step);

        //Writing boundaries of index
        dataStream.writeLong(getStartingRecordNumber());
        dataStream.writeLong(getLastRecordNumber());

        //Writing number of meta-records
        dataStream.writeInt(metadata.size());

        //Writing meta records
        for (Map.Entry<String, String> e : metadata.entrySet()) {
            dataStream.writeUTF(e.getKey());
            dataStream.writeUTF(e.getValue());
        }

        //Writing number of entries
        dataStream.writeInt(index.size());

        //Writing index
        long lastValue = 0, v;
        for (int i = 0; i < index.size(); ++i) {
            IOUtil.writeRawVarint64(dataStream, (v = index.get(i)) - lastValue);
            lastValue = v;
        }

        //Flushing gzip output stream to underlying stream
        deflate.finish();

        //Creating raw output stream
        DataOutputStream raw = new DataOutputStream(stream);

        //Writing non-compressed magic number
        raw.writeInt(MAGIC);

        //Writing index size
        raw.writeInt(bos.size());

        //Writes index
        raw.write(bos.toByteArray());
    }
952582
public void dump(Writer writer) throws IOException {
		Iterator<SaxBit> i = this.saxbits.iterator();
		while (i.hasNext()) {
			final SaxBit saxbit = i.next();
			saxbit.dump(writer);
		}
		writer.flush();
	}
384116
def write(self, *args, **kwargs):
        
        return self.stream.write(ending="", *args, **kwargs)
648466
protected void writeFull() {
        byte[] imageData = rawImage.getData();
        int numOfComponents = frameHeader.getNf();
        int[] pixes = new int[numOfComponents * DCTSIZE2];
        int blockIndex = 0;
        int startCoordinate = 0, scanlineStride = numOfComponents * rawImage.getWidth(), row = 0;

        x = 0;
        y = 0;

        for (int m = 0; m < MCUsPerColumn * MCUsPerRow; m++) {
            blockIndex = 0;

            // one MCU
            for (int v = 0; v < maxVSampleFactor; v++) {
                for (int h = 0; h < maxHSampleFactor; h++) {
                    row = y + 1;
                    startCoordinate = (y * rawImage.getWidth() + x) * numOfComponents;

                    // one block
                    for (int k = blockIndex * DCTSIZE2, i = 0; k < blockIndex * DCTSIZE2 + DCTSIZE2; k++) {
                        pixes[i++] = allMCUDatas[0][m][k];

                        if (numOfComponents > 1) {
                            pixes[i++] = allMCUDatas[1][m][k];
                            pixes[i++] = allMCUDatas[2][m][k];
                        }

                        if (numOfComponents > 3) {
                            pixes[i++] = allMCUDatas[3][m][k];
                        }

                        x++;

                        if (x % 8 == 0) {
                            y++;
                            x -= 8;
                        }
                    }

                    colorConvertor.convertBlock(pixes, 0, imageData, numOfComponents, startCoordinate, row,
                                                scanlineStride);

                    blockIndex++;

                    x += 8;
                    y -= 8;
                }

                x -= maxHSampleFactor * 8;
                y += 8;
            }

            x += maxHSampleFactor * 8;
            y -= maxVSampleFactor * 8;

            if (x >= rawImage.getWidth()) {
                x = 0;
                y += maxVSampleFactor * 8;
            }

        }
    }
218439
def _write_bytes(stream: Union[StdSim, TextIO], to_write: bytes) -> None:
        
        try:
            stream.buffer.write(to_write)
        except BrokenPipeError:
            # This occurs if output is being piped to a process that closed
            pass
694355
void write(ObjectOutputStream out) throws IOException {
        PutField fields = out.putFields();

        fields.put(CONTEXT, threadContextDescriptor.serialize());

        fields.put(EXEC_PROPS, threadContextDescriptor.getExecutionProperties());

        fields.put(INTERNAL_PROP_NAMES, internalPropNames);

        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        ObjectOutputStream oout = new ObjectOutputStream(bout);
        oout.writeObject(object);
        oout.flush();
        fields.put(OBJECT, bout.toByteArray());
        oout.close();

        out.writeFields();
    }
145024
private void writeLengthToStream(int length, OutputStream out) throws IOException {
    sharedByteBuffer.clear();
    sharedByteBuffer.order(ByteOrder.BIG_ENDIAN).putInt(length);
    sharedByteBuffer.flip();
    out.write(sharedByteBuffer.array(), 0, Ints.BYTES);
    sharedByteBuffer.order(byteOrder);
  }
1205325
private void writeToImpl(Writer out, String encoding, byte[] bufferToWrite, int bufferToWriteLen)
            throws IOException {
        String writeStr;
        if (encoding != null) {
            writeStr = new String(bufferToWrite, 0, bufferToWriteLen, encoding);
        } else {
            writeStr = new String(bufferToWrite, 0, bufferToWriteLen);
        }
        out.write(writeStr);
    }
614460
@Override
  public void closeWrite() throws IOException
  {
    if (_isCloseWrite) {
      return;
    }
    
    _isCloseWrite = true;
    
    //OutputStream os = _os;
    //_os = null;
    
    boolean isShutdownOutput = false;

    // since the output stream is opened lazily, we might
    // need to open it
    if (_s != null) {
      try {
        _s.shutdownOutput();
        
        isShutdownOutput = true;
      } catch (UnsupportedOperationException e) {
        log.log(Level.FINEST, e.toString(), e);
      } catch (Exception e) {
        log.finer(e.toString());
        log.log(Level.FINEST, e.toString(), e);
      }
    }

    /*
    // SSLSocket doesn't support shutdownOutput()
    if (! isShutdownOutput && os != null) {
      os.close();
    }
    */
  }
760326
private function write()
    {
        ftruncate($this->handle, 0);
        rewind($this->handle);

        fwrite($this->handle, serialize($this->data));
    }
919786
private void write(final DataInputStream stream, final Writer outputWriter, final int numberOfBytes)
      throws IOException {
    final byte[] buf = new byte[65535];
    int lenRemaining = numberOfBytes;
    while (lenRemaining > 0) {
      final int len = stream.read(buf, 0, lenRemaining > 65535 ? 65535 : lenRemaining);
      if (len > 0) {
        outputWriter.write(new String(buf, 0, len, "UTF-8"));
        lenRemaining -= len;
      } else {
        break;
      }
    }
  }
869903
public void writeTo(OutputStream out) throws IOException {
        out.write(this.content);
        out.flush();
        out.close();
    }
1244698
def write_output(self):
        """"""
        for data in self.output_data.values():
            self.create_output(data.get('key'), data.get('value'), data.get('type'))
1328538
public void generateOutput(Writer outputWriter) throws IOException {
        String s = generateOutput();
        outputWriter.write(s);
    }
1296163
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
        // Write out capacity and any hidden stuff
        s.defaultWriteObject();
    }
640751
public static void writeToOutputStream(String s, OutputStream output) throws IOException {
		writeToOutputStream(s, output, null);
	}