[TARGET writer(BlobWriteOption...)]
481319
public void writer() throws IOException {
    // [START writer]
    byte[] content = "Hello, World!".getBytes(UTF_8);
    try (WriteChannel writer = blob.writer()) {
      try {
        writer.write(ByteBuffer.wrap(content, 0, content.length));
      } catch (Exception ex) {
        // handle exception
      }
    }
    // [END writer]
  }
382323
protected void setWriter( Writer writer)
    {
    writer_ =
      writer == null
      ? writerFor( System.out)
      : writer;
    }
410413
function writeSubTableHeader(writer, platform, encoding, offset) {
            writer.writeUint16(platform); // platform
            writer.writeUint16(encoding); // encoding
            writer.writeUint32(offset); // offset
            return writer;
        }
648638
private void writeIlinkArgs(final PropertyWriter writer, final String linkID, final String[] args)
      throws SAXException {
    for (final String arg : args) {
      if (arg.charAt(0) == '/' || arg.charAt(0) == '-') {
        final int equalsPos = arg.indexOf('=');
        if (equalsPos > 0) {
          final String option = "option." + arg.substring(0, equalsPos - 1);
          writer.write(linkID, option + ".enabled", "1");
          writer.write(linkID, option + ".value", arg.substring(equalsPos + 1));
        } else {
          writer.write(linkID, "option." + arg.substring(1) + ".enabled", "1");
        }
      }
    }
  }
341951
def Serialize(self, writer):
        
        self.SerializeUnsigned(writer)
        writer.WriteSerializableArray(self.scripts)
749393
def _write_to_next_free(tag, blob):
    """"""
    ind = 0
    pref = '/tmp/peyotl-' + tag + str(ind)
    while os.path.exists(pref):
        ind += 1
        pref = '/tmp/peyotl-' + tag + str(ind)
    write_as_json(blob, pref)
1066944
def _write(self, *args, **kwargs):
        
        if self.filter_fn(*args, **kwargs):
            self.stream.write(*args, **kwargs)
254433
async function write(filename, object, options = undefined) {
  const {encoding, flag, ...opts} = normalizeOptions(options)

  if (!isNumber(filename)) {
    filename = toAbsolute(base, filename)

    opts.filename = filename
  }

  await fs.writeFile(filename, yaml.dump(object, opts), {encoding, flag})
}
1344105
async def dump_blob(writer, elem, elem_type, params=None):
    
    elem_is_blob = isinstance(elem, x.BlobType)
    data = bytes(getattr(elem, x.BlobType.DATA_ATTR) if elem_is_blob else elem)
    await dump_varint(writer, len(elem))
    await writer.awrite(data)
1247877
private void writeLinkOptions(final String baseDir, final PropertyWriter writer, final TargetInfo linkTarget)
      throws SAXException {
    if (linkTarget != null) {
      final ProcessorConfiguration config = linkTarget.getConfiguration();
      if (config instanceof CommandLineLinkerConfiguration) {
        final CommandLineLinkerConfiguration linkConfig = (CommandLineLinkerConfiguration) config;

        if (linkConfig.getLinker() instanceof BorlandLinker) {
          final String linkID = "win32.Debug_Build.win32b.ilink32";
          writeIlinkArgs(writer, linkID, linkConfig.getPreArguments());
          writeIlinkArgs(writer, linkID, linkConfig.getEndArguments());
          writer.write(linkID, "param.libfiles.1", "cw32mt.lib");
          writer.write(linkID, "param.libfiles.2", "import32.lib");
          int libIndex = 3;
          final String[] libNames = linkConfig.getLibraryNames();
          for (final String libName : libNames) {
            writer.write(linkID, "param.libfiles." + libIndex++, libName);
          }
          final String startup = linkConfig.getStartupObject();
          if (startup != null) {
            writer.write(linkID, "param.objfiles.1", startup);
          }
        } else {
          final String linkID = "linux.Debug_Build.gnuc++.g++link";
          writeLdArgs(writer, linkID, linkConfig.getPreArguments());
          writeLdArgs(writer, linkID, linkConfig.getEndArguments());
        }
      }
    }
  }
547669
function writeHeader() {
                seekHead = createSeekHead();
                
                var
                    ebmlHeader = {
                        "id": 0x1a45dfa3, // EBML
                        "data": [
                            {
                                "id": 0x4286, // EBMLVersion
                                "data": 1
                            },
                            {
                                "id": 0x42f7, // EBMLReadVersion
                                "data": 1
                            },
                            {
                                "id": 0x42f2, // EBMLMaxIDLength
                                "data": 4
                            },
                            {
                                "id": 0x42f3, // EBMLMaxSizeLength
                                "data": 8
                            },
                            {
                                "id": 0x4282, // DocType
                                "data": "webm"
                            },
                            {
                                "id": 0x4287, // DocTypeVersion
                                "data": 2
                            },
                            {
                                "id": 0x4285, // DocTypeReadVersion
                                "data": 2
                            }
                        ]
                    },
                    
                    segmentInfo = {
                        "id": 0x1549a966, // Info
                        "data": [
                            {
                                "id": 0x2ad7b1, // TimecodeScale
                                "data": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)
                            },
                            {
                                "id": 0x4d80, // MuxingApp
                                "data": "webm-writer-js",
                            },
                            {
                                "id": 0x5741, // WritingApp
                                "data": "webm-writer-js"
                            },
                            segmentDuration // To be filled in later
                        ]
                    },
                    
                    tracks = {
                        "id": 0x1654ae6b, // Tracks
                        "data": [
                            {
                                "id": 0xae, // TrackEntry
                                "data": [
                                    {
                                        "id": 0xd7, // TrackNumber
                                        "data": DEFAULT_TRACK_NUMBER
                                    },
                                    {
                                        "id": 0x73c5, // TrackUID
                                        "data": DEFAULT_TRACK_NUMBER
                                    },
                                    {
                                        "id": 0x9c, // FlagLacing
                                        "data": 0
                                    },
                                    {
                                        "id": 0x22b59c, // Language
                                        "data": "und"
                                    },
                                    {
                                        "id": 0x86, // CodecID
                                        "data": "V_VP8"
                                    },
                                    {
                                        "id": 0x258688, // CodecName
                                        "data": "VP8"
                                    },
                                    {
                                        "id": 0x83, // TrackType
                                        "data": 1
                                    },
                                    {
                                        "id": 0xe0,  // Video
                                        "data": [
                                            {
                                                "id": 0xb0, // PixelWidth
                                                "data": videoWidth
                                            },
                                            {
                                                "id": 0xba, // PixelHeight
                                                "data": videoHeight
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    };
                
                ebmlSegment = {
                    "id": 0x18538067, // Segment
                    "size": -1, // Unbounded size
                    "data": [
                        seekHead,
                        segmentInfo,
                        tracks,
                    ]
                };
                
                var
                    bufferStream = new ArrayBufferDataStream(256);
                    
                writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);
                blobBuffer.write(bufferStream.getAsDataArray());
                
                // Now we know where these top-level elements lie in the file:
                seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);
                seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);
            }
330964
public void writeMessage( Writer writer, String targetOrigin ) throws IOException
	{
		writeMessage( writer, messageFormatter, targetOrigin );
	}
1073248
@Override
  public GoogleCloudStorageFileSet finish(Collection<? extends OutputWriter<ByteBuffer>> writers) {
    List<String> out = Lists.newArrayList();
    for (OutputWriter<ByteBuffer> w : writers) {
      GoogleCloudStorageFileOutputWriter writer = (GoogleCloudStorageFileOutputWriter) w;
      out.add(writer.getFile().getObjectName());
    }
    return new GoogleCloudStorageFileSet(bucket, out);
  }
1213619
def write(klass, document, target=None, stylesheet=""):
        
        writer = LatexWriter(document, target, stylesheet)
        return writer.go()
613342
public static void writeFile (byte[] bytes, String targetFileName) throws OSHelperException {
		FileOutputStream fos;
		try {
			fos = new FileOutputStream (targetFileName);
		} catch (FileNotFoundException ex) {
			throw new OSHelperException ("Received a FileNotFoundException when trying to open target file " + targetFileName + ".", ex);
		}
		try {
			fos.write (bytes);
		} catch (IOException ex) {
			throw new OSHelperException ("Received an IOException when trying to write to target file " + targetFileName + ".", ex);
		} finally {
			try {
				fos.close ();
			} catch (IOException ex) {
				throw new OSHelperException ("Received an IOException when trying to close FileOutputStream for target file " + targetFileName + ".", ex);
			}
		}
	}
1133158
def WriteBlobs(self, blob_id_data_map, cursor=None):
    """"""
    chunks = []
    for blob_id, blob in iteritems(blob_id_data_map):
      chunks.extend(_BlobToChunks(blob_id.AsBytes(), blob))
    for values in _PartitionChunks(chunks):
      _Insert(cursor, "blobs", values)
907704
@Override
    public ExtendedSnapshotWriter newSnapshotWriter() throws StorageException {
        checkInitialized();

        try {
            return new SnapshotFileWriter(snapshotsDirectory);
        } catch (Exception e) {
            throw new StorageException("fail create snapshot request", e);
        }
    }