@Nullable private static String toHeaderValue(MessageBytes value) { switch (value.getType()) { case MessageBytes.T_BYTES: { final ByteChunk chunk = value.getByteChunk(); return new String(chunk.getBuffer(), chunk.getOffset(), chunk.getLength(), StandardCharsets.US_ASCII); } case MessageBytes.T_CHARS: { final CharChunk chunk = value.getCharChunk(); return new String(chunk.getBuffer(), chunk.getOffset(), chunk.getLength()); } case MessageBytes.T_STR: { return value.getString(); } } return null; } }
@Nullable private static AsciiString toHeaderName(MessageBytes value) { switch (value.getType()) { case MessageBytes.T_BYTES: { final ByteChunk chunk = value.getByteChunk(); return new AsciiString(chunk.getBuffer(), chunk.getOffset(), chunk.getLength(), true); } case MessageBytes.T_CHARS: { final CharChunk chunk = value.getCharChunk(); return new AsciiString(chunk.getBuffer(), chunk.getOffset(), chunk.getLength()); } case MessageBytes.T_STR: { return HttpHeaderNames.of(value.getString()); } } return null; }
public boolean ready() throws IOException { return (cb.getLength() > 0); }
public boolean ready() throws IOException { return (cb.getLength() > 0); }
public int available() throws IOException { if (state == BYTE_STATE) { return bb.getLength(); } else if (state == CHAR_STATE) { return cb.getLength(); } else { return 0; } }
public int getAvailable() { if (eof || closed) { return -1; } int available = 0; if (state != CHAR_STATE) { available = bb.getLength(); } else { available = cb.getLength(); } return available; }
public int getAvailable() { if (eof || closed) { return -1; } int available = 0; if (state != CHAR_STATE) { available = bb.getLength(); } else { available = cb.getLength(); } return available; }
public void append( CharChunk src ) throws IOException { append( src.getBuffer(), src.getOffset(), src.getLength()); }
public int available() { int available = 0; if (state == BYTE_STATE) { available = bb.getLength(); } else if (state == CHAR_STATE) { available = cb.getLength(); } if (available == 0) { coyoteRequest.action(ActionCode.AVAILABLE, null); available = (coyoteRequest.getAvailable() > 0) ? 1 : 0; } return available; }
public void append( CharChunk src ) throws IOException { append( src.getBuffer(), src.getOffset(), src.getLength()); }
public void append( CharChunk src ) throws IOException { append( src.getBuffer(), src.getOffset(), src.getLength()); }
public void append( CharChunk src ) throws IOException { append( src.getBuffer(), src.getOffset(), src.getLength()); }
public void append( CharChunk src ) throws IOException { append( src.getBuffer(), src.getOffset(), src.getLength()); }
public int available() { int available = 0; if (state == BYTE_STATE) { available = bb.getLength(); } else if (state == CHAR_STATE) { available = cb.getLength(); } if (available == 0) { coyoteRequest.action(ActionCode.AVAILABLE, null); available = (coyoteRequest.getAvailable() > 0) ? 1 : 0; } return available; }
public boolean equals(CharChunk cc) { return equals(cc.getChars(), cc.getStart(), cc.getLength()); }
public boolean equals(CharChunk cc) { return equals( cc.getChars(), cc.getOffset(), cc.getLength()); }
public void append( CharChunk src ) throws IOException { append( src.getBuffer(), src.getOffset(), src.getLength()); }
public void append( CharChunk src ) throws IOException { append( src.getBuffer(), src.getOffset(), src.getLength()); }
public int available() { int available = 0; if (state == BYTE_STATE) { available = bb.getLength(); } else if (state == CHAR_STATE) { available = cb.getLength(); } if (available == 0) { coyoteRequest.action(ActionCode.AVAILABLE, null); available = (coyoteRequest.getAvailable() > 0) ? 1 : 0; } return available; }