Puts a single byte if the buffer is not yet full.

@return true if the byte was put, or false if the buffer is full
501610
public synchronized boolean put(byte value) {
        if (available == capacity) {
            return false;
        }
        buffer[idxPut] = value;
        idxPut = (idxPut + 1) % capacity;
        available++;
        return true;
    }
649878
@Override
	public boolean appendOutgoingData()
	{
		while (outputBuffer.remaining() > 0)
		{
			if (packetOutputBuffer.size() == 0)
			{
				if (sendQueue.size() == 0)
					return true; // No more packet to send
				
				if (outputBuffer.remaining() < 4) // packet_size = sizeof(int) = 4
					return true; // Not enough space to proceed
				
				// Write packet size
				if (!serializePacket(sendQueue.getFirst(),packetOutputBuffer))
					return false; // Invalid packet
				outputBuffer.putInt(packetOutputBuffer.size());
				currentOutputOffset = 0;
			}
			else
			{
				int writeAmount = Math.min(outputBuffer.remaining(),packetOutputBuffer.size() - currentOutputOffset);
				packetOutputBuffer.putTo(outputBuffer, currentOutputOffset, writeAmount);
				currentOutputOffset += writeAmount;
				
				// Packet completly sent ?
				if (currentOutputOffset == packetOutputBuffer.size())
				{
					AbstractPacket sentPacket;
					synchronized (sendQueue)
					{
						sentPacket = sendQueue.removeFirst();
					}
					packetOutputBuffer.clear();
					
					if (listener != null)
						listener.packetSent(sentPacket);
				}
			}
		}
		return true;
	}
196793
private static int put(byte[] block, int offset, ByteBuffer buf) {
    int len = Math.min(block.length - offset, buf.remaining());
    buf.get(block, offset, len);
    return len;
  }
1302237
protected void put(ByteBuffer bb) {
       if(_buffer.remaining() < bb.remaining()) {
           int newCapacity = Math.max(_buffer.capacity() << 1, _buffer.position() + bb.remaining());
           ByteBuffer b = ByteBuffer.allocate(newCapacity);
           _buffer.flip();
           b.put(_buffer);
           _buffer = b;
       }
       
       _buffer.put(bb);
    }
1005538
public Packer putBytesF(final byte[] value) {
		putInt(value.length);
		ensureCapacity(bufPosition + value.length);
		System.arraycopy(value, 0, buf, bufPosition, value.length);
		bufPosition += value.length;
		return this;
	}
821341
@Override
    public int smallByteSize() {
        int bound = byteSize();
        ByteBuffer buf = ByteBuffer.allocate(bound);
        asSmallBytes(buf);
        return buf.position();
    }
220579
public void setBuffer (byte[] bytes, int offset, int count) {
		if (bytes == null) throw new IllegalArgumentException("bytes cannot be null.");
		buffer = bytes;
		position = offset;
		limit = offset + count;
		capacity = bytes.length;
		total = 0;
		inputStream = null;
	}
91323
public Packer putBytes(final byte[] value) {
		putVInt(value.length);
		ensureCapacity(bufPosition + value.length);
		System.arraycopy(value, 0, buf, bufPosition, value.length);
		bufPosition += value.length;
		return this;
	}
808090
public final boolean isOutCommitted()
  {
    OutHttpApp stream = out();
    
    if (stream.isCommitted()) {
      return true;
    }

    // server/05a7
    if (_contentLengthOut > 0 && _contentLengthOut <= stream.contentLength()) {
      return true;
    }

    return false;
  }
1152924
@Contract(pure = true)
	public boolean hasRemainingBytes(int remaining) {
		assert remaining >= 0;
		if (remaining == 0) return true;
		for (int i = first; i != last; i = next(i)) {
			int bufRemaining = bufs[i].readRemaining();
			if (bufRemaining >= remaining)
				return true;
			remaining -= bufRemaining;
		}
		return false;
	}
44451
public boolean write(byte []buffer, int offset, int length)
  {
    if (length == 0) {
      return true; // throw new IllegalStateException();
    }
    
    int count = length / BLOCK_SIZE + 1;
    
    if (_tailAddress <= _index + length + PAD + 2 * count) {
      return false;
    }

    _crc.update(buffer, offset, length);
    
    byte []headerBuffer = _headerBuffer;
    
    while (length > 0) {
      int sublen = Math.min(length, BLOCK_SIZE);
      
      BitsUtil.writeInt16(headerBuffer, 0, sublen);
      
      writeImpl(headerBuffer, 0, 2);
      writeImpl(buffer, offset, sublen);
      
      length -= sublen;
      offset += sublen;
    }
    
    return true;
  }
197936
protected boolean checkBuffer() throws IOException {
        if (!enableMultiReadofPostData) {
            if (null != this.buffer) {
                if (this.buffer.hasRemaining()) {
                    return true;
                }
                this.buffer.release();
                this.buffer = null;
            }
            try {
                this.buffer = this.isc.getRequestBodyBuffer();
                if (null != this.buffer) {
                    // record the new amount of data read from the channel
                    this.bytesRead += this.buffer.remaining();
                    // Tr.debug(tc, "Buffer=" + WsByteBufferUtils.asString(this.buffer));
                    return true;
                }
                return false;
            } catch (IOException e) {
                this.error = e;
                throw e;
            }
        } else {
            return checkMultiReadBuffer();
        }
    }
673177
private boolean checkBuffer(long offset) throws IOException {
    if (offset - bufferOffset < 0 || offset - bufferOffset >= currentBufferSize) {
      // the given offset is not contained in the buffer
      bufferOffset = offset;
      int index = 0;
      input.seek(offset);
      try {
        //input.read(buffer, 0, maxBufferSize);
        for (long pos = offset; pos < offset + maxBufferSize; pos++) {
          int ch = input.read();
          if (ch > -1) {
            buffer[index] = (byte)ch;
            index++;
          }
        }
      } catch (IOException ex) {
        // not possible
        ex.printStackTrace();
      }
      currentBufferSize = index;
      return true;
    }
    return false;
  }
1139762
public boolean Add(T value) {
        if (m_Count < m_Capacity) {
            m_Array[++m_Count] = value;
            UpHeap();
        }
        else if (greaterThan(m_Array[1], value)) {
            m_Array[1] = value;
            DownHeap();
        }
        else return false;
        return true;
    }
549094
public synchronized boolean update()
        throws IOException
    {
        if (_resource!=null && !_resource.exists())
        {
            clear();
            return true;
        }
        
        long lm=_resource.lastModified();
        
        if (lm==_lastModified && (_buf!=null || _list!=null))
            return false;
        _lastModified=lm;
        
        if (_resource.isDirectory())
            _list=_resource.list();

        if (_list==null)
        {
            int l=(int)_resource.length();
            if (l<0)
                l=1024;
            ByteArrayOutputStream2 bout = new ByteArrayOutputStream2(l);
            InputStream in = _resource.getInputStream();
            try{IO.copy(in,bout);} finally {in.close();}
            _buf=bout.getBuf();
            if (_buf.length!=l)
                _buf=bout.toByteArray();
        }
        return true;
    }
362086
public boolean containsSymbol(char[] buffer, int offset, int length) {

        // search for identical symbol
        int bucket = hash(buffer, offset, length) % fTableSize;
        OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
            if (length == entry.characters.length) {
                for (int i = 0; i < length; i++) {
                    if (buffer[offset + i] != entry.characters[i]) {
                        continue OUTER;
                    }
                }
                return true;
            }
        }

        return false;

    }
50652
public void put(byte[] bytes, int start, int end) {
        byte[] buffer = chunk();
        
        for (int i = start; i < end; i++) {
            if (position == buffer.length) {
                buffer = alloc();
            }
            
            buffer[position++] = bytes[i];
            size++;
        }
    }