Returns true if value written to file or false if not enough space
(writes and end-of-file marker in the fixed-length memory mapped file).

@param t
value to write to the serialized queue
@return true if written, false if not enough space
195035
public boolean offer(T t) {
		// the current position will be just past the length bytes for this
		// item (length bytes will be 0 at the moment)
		int serializedLength = serializer.size();
		if (serializedLength == UNKNOWN_LENGTH) {
			return offerUnknownLength(t);
		} else {
			return offerKnownLength(t, serializedLength);
		}
	}
6256
@Override
	public boolean write(Writer writer) throws IOException {

		writeBlock(writer, EmblPadding.PA_PADDING, accession);

		return true;
	}
12544
public void writeTo(java.io.OutputStream os, int start_offset, int length) throws IOException {
        int towrite = min(length, _write_pos-start_offset);
        int writeoff = start_offset;
        if (towrite > 0) {
            while (towrite >= _window_size) {
                moveWindow(writeoff);
                os.write(_memory_buffer,0,_window_size);
                towrite -= _window_size;
                writeoff += _window_size;
            }
            if (towrite > 0) {
                moveWindow(writeoff);
                os.write(_memory_buffer,0,towrite);
            }
        }
    }
270428
@Override
  public void writeTop(JsonWriterImpl out, T value)
  {
    out.writeStartArray();
    write(out, value);
    out.writeEndArray();
  }
423060
@Override
    public final void write(final byte[] b) throws IOException {
        file.write(b);
        counter = counter + b.length;
    }
752053
public boolean hasNext() {

        // for chained iterators
        if (chained) {
            if (it1 == null) {
                if (it2 == null) {
                    return false;
                }

                if (it2.hasNext()) {
                    return true;
                }

                it2 = null;

                return false;
            } else {
                if (it1.hasNext()) {
                    return true;
                }

                it1 = null;

                return hasNext();
            }
        }

        // for other interators
        if (elements == null) {
            return false;
        }

        for (; notNull && i < elements.length && elements[i] == null; i++) {}

        if (i < elements.length) {
            return true;
        } else {

            // release elements for garbage collection
            elements = null;

            return false;
        }
    }
1073402
protected boolean isAllowed(File path, boolean write) throws IOException {
		return isAllowedInternal(path, write, config.isReadOnly());
	}
827587
@Synchronized
    public boolean isEndOfData() {
        return futureSegments.isEmpty() && unassignedSegments.isEmpty() &&
                assignedSegments.values().stream().allMatch(Map::isEmpty);
    }
1257475
protected long writeValue(File file, ValueData value) throws IOException
   {
      if (value.isByteArray())
      {
         return writeByteArrayValue(file, value);
      }
      else
      {
         return writeStreamedValue(file, value);
      }
   }
162838
def write(self, value):
        

        if self.capacity > 0 and self.strategy == 0:
            len_value = len(value)
            if len_value >= self.capacity:
                needs_new_strategy = True
            else:
                self.seek(0, 2)  # find end of file
                needs_new_strategy = \
                    (self.tell() + len_value) >= self.capacity
            if needs_new_strategy:
                self.makeTempFile()

        if not isinstance(value, six.binary_type):
            value = value.encode('utf-8')

        self._delegate.write(value)
234367
public void write(int value) throws IOException {
    if (pos >= buf.length) {
      if (pos >= getMaxPacketLength() && !bufferContainDataAfterMark) {
        //buffer is more than a Packet, must flushBuffer()
        flushBuffer(false);
      } else {
        growBuffer(1);
      }
    }
    buf[pos++] = (byte) value;
  }
28612
@Override
  public void write(byte []buf, int offset, int length, boolean isEnd)
    throws IOException
  {
    while (length > 0) {
      if (_tail == null) {
        addBuffer(TempBuffer.create());
      }
      else if (_tail.buffer().length <= _tail.length()) {
        addBuffer(TempBuffer.create());
      }
      
      TempBuffer tail = _tail;

      int sublen = Math.min(length, tail.buffer().length - tail.length());

      System.arraycopy(buf, offset, tail.buffer(), tail.length(), sublen);

      length -= sublen;
      offset += sublen;
      _tail.length(_tail.length() + sublen);
    }
  }
241563
private int writeShort(String value, int offset, int end)
    throws IOException
  {
    int ch;
  
    OutputStreamWithBuffer os = _os;
    byte []buffer = os.buffer();
    int bOffset = os.offset();
    
    end = Math.min(end, offset + buffer.length - bOffset);
  
    for (; offset < end && (ch = value.charAt(offset)) < 0x80; offset++) {
      buffer[bOffset++] = (byte) ch;
    }
    
    os.offset(bOffset);
    
    return offset;
  }
667190
private final void write(byte dataType, int timestamp, ITag tag) {
        if (tag != null) {
            // only allow blank tags if they are of audio type
            if (tag.getBodySize() > 0 || dataType == ITag.TYPE_AUDIO) {
                try {
                    if (timestamp >= 0) {
                        if (!writer.writeTag(tag)) {
                            log.warn("Tag was not written");
                        }
                    } else {
                        log.warn("Skipping message with negative timestamp");
                    }
                } catch (ClosedChannelException cce) {
                    // the channel we tried to write to is closed, we should not try again on that writer
                    log.error("The writer is no longer able to write to the file: {} writable: {}", path.getFileName(), path.toFile().canWrite());
                } catch (IOException e) {
                    log.warn("Error writing tag", e);
                    if (e.getCause() instanceof ClosedChannelException) {
                        // the channel we tried to write to is closed, we should not try again on that writer
                        log.error("The writer is no longer able to write to the file: {} writable: {}", path.getFileName(), path.toFile().canWrite());
                    }
                }
            }
        }
    }
528890
public boolean write(DataOutputStream daOut, boolean bFixedLength)
    {
        Object data = this.getData();
        if (data == null)
            data = Constants.BLANK;
        ObjectOutputStream p = null;
        try   {
            p = new ObjectOutputStream(daOut);
            p.writeObject(data);
            p.flush();
            p.close();  // Unlink ObjectOutputStream
        } catch (IOException ex)    {
            ex.printStackTrace();   // Never
            return false;
        }
        return true;    // Success
    }
299382
@Override
  public void writeChunk(long length, boolean isFinal)
  {
    long chunk;
    
    if (isFinal) {
      chunk = length << 1;
    }
    else {
      chunk = (length << 1) + 1;
    }
    
    writeUnsigned(chunk);
  }
305142
public <T extends Object> void writeValue(T value) throws IOException {
        writeValue(value, (Class<T>) value.getClass());
    }