public void put(Buffer buffer) throws IOException { for (int i = 0; i < _fields.size(); i++) { Field field = (Field) _fields.get(i); if (field != null && field._revision == _revision) field.put(buffer); } BufferUtil.putCRLF(buffer); }
public static Buffer toBuffer(long value) { ByteArrayBuffer buf=new ByteArrayBuffer(16); putDecLong(buf, value); return buf; }
public String getValue() { if (_stringValue==null) _stringValue=BufferUtil.to8859_1_String(_value); return _stringValue; }
_serverName=BufferUtil.to8859_1_String(hostPort.peek(hostPort.getIndex(), i)); _port=BufferUtil.toInt(hostPort.peek(hostPort.getIndex()+i+1, hostPort.length()-i-1)); return _serverName; _serverName=BufferUtil.to8859_1_String(hostPort); _port = 0;
if (BufferUtil.isPrefix(MimeTypes.MULTIPART_BYTERANGES_BUFFER, field.getValueBuffer())) _contentLength = HttpTokens.SELF_DEFINING_CONTENT; _header.put(HttpTokens.COLON); _header.put((byte) ' '); BufferUtil.putDecLong(_header, _contentLength); _header.put(HttpTokens.CRLF);
BufferUtil.prependHexInt(_buffer, size); _needCRLF = false; BufferUtil.putHexInt(_header, size); _header.put(HttpTokens.CRLF);
if (digit>='1'&&digit<='5') _responseStatus = BufferUtil.toInt(_tok1); _handler.startResponse(HttpVersions.CACHE.lookup(_tok0), _responseStatus,_buffer.sliceFromMark()); if (_contentLength != HttpTokens.CHUNKED_CONTENT) _contentLength=BufferUtil.toLong(value); if (_contentLength <= 0) _contentLength=HttpTokens.NO_CONTENT;
/** * Sets the value of an long field. * * @param name the field name * @param value the field long value */ public void putLongField(Buffer name, long value) { Buffer v = BufferUtil.toBuffer(value); put(name, v, value); }
public long getLongValue() { if (_numValue == -1) _numValue = BufferUtil.toLong(_value); return _numValue; }
/** * Sets the value of an long field. * * @param name the field name * @param value the field long value */ public void addLongField(Buffer name, long value) { Buffer v = BufferUtil.toBuffer(value); add(name, v, value); }
public String getName() { return BufferUtil.to8859_1_String(_name); }
/** * Sets the value of an long field. * * @param name the field name * @param value the field long value */ public void putLongField(String name, long value) { Buffer n = HttpHeaders.CACHE.lookup(name); Buffer v = BufferUtil.toBuffer(value); put(n, v, value); }
BufferUtil.putCRLF(buffer);
public Object nextElement() throws NoSuchElementException { if (field != null || hasMoreElements()) { String n = BufferUtil.to8859_1_String(field._name); field = null; return n; } throw new NoSuchElementException(); } };
/** * Sets the value of an long field. * * @param name the field name * @param value the field long value */ public void addLongField(String name, long value) { Buffer n = HttpHeaders.CACHE.lookup(name); Buffer v = BufferUtil.toBuffer(value); add(n, v, value); }
/** * @return the value of a field, or null if not found. For multiple fields of the same name, * only the first is returned. * @param name the case-insensitive field name */ public String getStringField(Buffer name) { // TODO - really reuse strings from previous requests! Field field = getField(name); if (field != null && field._revision == _revision) return BufferUtil.to8859_1_String(field._value); return null; }
public String toString() { try { ByteArrayBuffer buffer = new ByteArrayBuffer(4096); put(buffer); return BufferUtil.to8859_1_String(buffer); } catch (Exception e) { e.printStackTrace(); } return null; }
String val = valueParameters(BufferUtil.to8859_1_String(field._value), null); if (val == null) return -1;