@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; }
/** * @return the buffer. */ public char[] getChars() { return getBuffer(); }
public char[] getChars() { return getBuffer(); }
public char[] getChars() { return getBuffer(); }
public char[] getChars() { return getBuffer(); }
public char[] getChars() { return getBuffer(); }
public char[] getChars() { return getBuffer(); }
public char[] getChars() { return getBuffer(); }
public char[] getChars() { return getBuffer(); }
/** Convert a buffer of bytes into a chars * @deprecated */ public void convert( ByteChunk bb, CharChunk cb ) throws IOException { // Set the ByteChunk as input to the Intermediate reader convert(bb, cb, cb.getBuffer().length - cb.getEnd()); }
/** * Find the position of the last slash in the given char chunk. */ private static final int lastSlash(CharChunk name) { char[] c = name.getBuffer(); int end = name.getEnd(); int start = name.getStart(); int pos = end; while (pos > start) { if (c[--pos] == '/') { break; } } return (pos); }
/** * Find the position of the last slash in the given char chunk. */ private static final int lastSlash(CharChunk name) { char[] c = name.getBuffer(); int end = name.getEnd(); int start = name.getStart(); int pos = end; while (pos > start) { if (c[--pos] == '/') { break; } } return pos; }
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 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()); }