(CharChunk out, ByteChunk bb)
| 125 | } |
| 126 | |
| 127 | private void urlEncode(CharChunk out, ByteChunk bb) throws IOException { |
| 128 | byte[] bytes = bb.getBuffer(); |
| 129 | for (int j = bb.getStart(); j < bb.getEnd(); j++) { |
| 130 | out.append('%'); |
| 131 | char ch = Character.forDigit((bytes[j] >> 4) & 0xF, 16); |
| 132 | out.append(ch); |
| 133 | ch = Character.forDigit(bytes[j] & 0xF, 16); |
| 134 | out.append(ch); |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | // -------------------- Internal implementation -------------------- |
| 139 |