write a 0-len array
325298
def write_array_empty(self, key, value):
        

        # ugly hack for length 0 axes
        arr = np.empty((1,) * value.ndim)
        self._handle.create_array(self.group, key, arr)
        getattr(self.group, key)._v_attrs.value_type = str(value.dtype)
        getattr(self.group, key)._v_attrs.shape = value.shape
1089260
def write_octet(self, n):
        
        if (n < 0) or (n > 255):
            raise ValueError('Octet out of range 0..255')
        self._flushbits()
        self.out.write(pack('B', n))
16015
function iterateWriteArray () {
    if (!isIterating()) { return undefined; }

    let data = iterateData;
    let content = data.collection[data.i];

    data.i++;

    if (data.i >= data.collection.length) {
        resetIterateData();

        writable.write(content, 'utf8', onWriteFinish);
    } else {
        writable.write(content, 'utf8', iterateWriteArray);
    }
}
244755
def write_long(self, n, pack=Struct('>I').pack):
        
        if 0 <= n <= 0xFFFFFFFF:
            self._output_buffer.extend(pack(n))
        else:
            raise ValueError('Long %d out of range 0..0xFFFFFFFF', n)
        return self
99267
def write_longlong(self, n, pack=Struct('>Q').pack):
        
        if 0 <= n <= 0xFFFFFFFFFFFFFFFF:
            self._output_buffer.extend(pack(n))
        else:
            raise ValueError(
                'Longlong %d out of range 0..0xFFFFFFFFFFFFFFFF', n)
        return self
831498
def write_short_at(self, n, pos, pack_into=Struct('>H').pack_into):
        '''
        
        '''
        if 0 <= n <= 0xFFFF:
            pack_into(self._output_buffer, pos, n)
        else:
            raise ValueError('Short %d out of range 0..0xFFFF', n)
        return self
1292876
function zeros (length) {
  const arr = []
  for (let i = 0; i < length; i++) {
    arr.push(0)
  }
  return arr
}
1181101
def write_long(self, number):
        
        buf = pack(self.byte_order + "q", number)
        self.write(buf)
1123817
public void write(byte[] b, int off, int len)
    {
        if (b == null) {
            throw new NullPointerException();
        } else if ((off < 0) || (off > b.length) || (len < 0) ||
               ((off + len) > b.length) || ((off + len) < 0)) {
            throw new IndexOutOfBoundsException();
        }
        size += len;
    }
402929
@Override
	public void write(byte[] b, int off, int len) {
		this.checkIncreaseArray(len);
		System.arraycopy(b, off, this.buffer, this.pos, len);
		this.pos += len;
	}
414303
def write(self, s, size=None):
        
        self._buffer.write(s)
        self._len_changed = True
1223830
private static void writeInt(int value, byte[] array, int offset) {
    for (int i = 0; i < 4; i++) {
      array[offset + i] = (byte) (value >>> (8 * i));
    }
  }
110429
@Override
    public synchronized void write(final byte[] b, final int off, final int len) {
        if (off < 0 || off > b.length || len < 0 || off + len - b.length > 0) {
            throw new IndexOutOfBoundsException();
        }
        ensureCapacity(super.count + len);
        System.arraycopy(b, off, super.buf, super.count, len);
        super.count += len;
    }
278035
public static void writeShort(byte b[], int offset, short value) {
    b[offset++] = (byte) (value >>> 8);
    b[offset] = (byte)value;
  }
151370
private void writeCharsToOut(char[] cbuf, int len) throws IOException {
		if(len > 0) {
			if(len == 1) {
				out.write(cbuf[0]);
			} else {
				out.write(cbuf, 0, len);
			}
		}
	}
757253
public void write(byte[] buf, int offset, int len) throws IOException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
    { // 306998.15
      Tr.debug(tc, "write len --> " + len + ", limit->" + limit);
    }
    if (len < 0)
    {
      if (tc.isErrorEnabled())
        Tr.error(tc, "Illegal.Argument.Trying.to.write.chars");
      throw new IllegalArgumentException();
    }
    if (!_hasWritten && obs != null)
    {
      _hasWritten = true;
      obs.alertFirstWrite();
    }

    if (limit > -1)
    {
      if (total + len > limit)
      {
        len = limit - total;
        except = new WriteBeyondContentLengthException();
      }
    }

    int toWrite = 0, amountWritten = 0, remaining = 0;

    while (amountWritten != len)
    {

      checkList();

      toWrite = len - amountWritten;
      remaining = current.remaining();

      if (toWrite <= remaining)
      {

        /*
         * We can write it all in the current buffer
         */
        current.put(buf, offset + amountWritten, toWrite);
        amountWritten += toWrite;
      }
      else
      {

        /*
         * Write what we can to the current position
         */
        current.put(buf, offset + amountWritten, remaining);
        amountWritten += remaining;
      }
    }
    count += len;
    total += len;
    check();
  }
950293
def write_serializable_array(self, array):
        
        if array is None:
            self.write_byte(0)
        else:
            self.write_var_int(len(array))
            for item in array:
                item.Serialize(self)