annotate src/org/eclipse/jetty/io/JBuffer.java @ 1066:bbbda7c6e8ec

fix use of HttpGenerator._header
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 09 Nov 2016 05:48:10 -0700
parents 158d1e6ac17f
children b4ba8a4d5a16
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 // tmp class to implement Buffer until I can get rid of it
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 package org.eclipse.jetty.io;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 import java.io.InputStream;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 import java.io.IOException;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 import java.nio.ByteBuffer;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 import org.slf4j.Logger;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 import org.slf4j.LoggerFactory;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 import org.eclipse.jetty.util.TypeUtil;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12
1048
2b769da7f67d remove Buffer
Franklin Schmidt <fschmidt@gmail.com>
parents: 1046
diff changeset
13 public final class JBuffer {
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 private static final Logger LOG = LoggerFactory.getLogger(JBuffer.class);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 private final ByteBuffer bb;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 public JBuffer(ByteBuffer bb) {
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 this.bb = bb;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21
1050
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
22 public int position() {
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
23 return bb.position();
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
24 }
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
25
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
26 public void position(int i) {
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
27 bb.position(i);
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
28 }
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
29
1062
4a50422596b6 fix JBuffer.getByteBuffer()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1061
diff changeset
30 public int limit() {
4a50422596b6 fix JBuffer.getByteBuffer()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1061
diff changeset
31 return bb.limit();
4a50422596b6 fix JBuffer.getByteBuffer()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1061
diff changeset
32 }
4a50422596b6 fix JBuffer.getByteBuffer()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1061
diff changeset
33
1050
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
34 public void limit(int i) {
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
35 bb.limit(i);
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
36 }
5ef954fad97b remove JBuffer.sliceFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1049
diff changeset
37
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
38 public byte[] array() {
1053
7e4b41247544 fix JBuffer.array()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1052
diff changeset
39 return bb.array();
7e4b41247544 fix JBuffer.array()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1052
diff changeset
40 }
7e4b41247544 fix JBuffer.array()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1052
diff changeset
41
7e4b41247544 fix JBuffer.array()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1052
diff changeset
42 public boolean hasArray() {
7e4b41247544 fix JBuffer.array()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1052
diff changeset
43 return bb.hasArray();
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
44 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
45
1048
2b769da7f67d remove Buffer
Franklin Schmidt <fschmidt@gmail.com>
parents: 1046
diff changeset
46 public JBuffer duplicate() {
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
47 return new JBuffer(bb.duplicate());
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
48 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
49
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
50 public int remaining() {
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
51 return bb.remaining();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
52 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
53
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
54 public boolean isReadOnly() {
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
55 return bb.isReadOnly();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
56 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
57
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
58 public boolean hasRemaining() {
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
59 return bb.hasRemaining();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
60 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
61
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
62 public byte get() {
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
63 return bb.get();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
64 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
65
1054
87275900646e remove JBuffer.toString()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1053
diff changeset
66 public void get(byte[] bytes) {
87275900646e remove JBuffer.toString()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1053
diff changeset
67 bb.get(bytes);
87275900646e remove JBuffer.toString()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1053
diff changeset
68 }
87275900646e remove JBuffer.toString()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1053
diff changeset
69
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
70 public void compact() {
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
71 bb.compact();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
72 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
73
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
74 public int capacity() {
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
75 return bb.capacity();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
76 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
77
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
78
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
79
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
80 public ByteBuffer getByteBuffer() {
1062
4a50422596b6 fix JBuffer.getByteBuffer()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1061
diff changeset
81 return bb;
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
82 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
83
1066
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
84 public void clear() {
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
85 bb.clear();
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
86 }
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
87
1065
158d1e6ac17f fix JBuffer.compact()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1064
diff changeset
88 public void clearJ() {
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
89 bb.position(0);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
90 bb.limit(0);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
91 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
92
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
93 public int space() {
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
94 return bb.capacity() - bb.limit();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
95 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
96
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
97
1060
957f758dcffc fix JBuffer.get()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1059
diff changeset
98 public void get(byte[] b, int offset, int length) {
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
99 bb.get(b,offset,length);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
100 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
101
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
102
1066
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
103 public void putQ(JBuffer src) {
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
104 bb.put(src.bb);
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
105 }
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
106
1048
2b769da7f67d remove Buffer
Franklin Schmidt <fschmidt@gmail.com>
parents: 1046
diff changeset
107 public int put(JBuffer src) {
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
108 return put(src.asArray());
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
109 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
110
1066
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
111 public void putQ(byte b) {
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
112 bb.put(b);
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
113 }
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
114
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
115 public void put(byte b)
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
116 {
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
117 ByteBuffer dup = bb.duplicate();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
118 dup.position(bb.limit());
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
119 dup.limit(bb.capacity());
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
120 dup.put(b);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
121 bb.limit(bb.limit()+1);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
122 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
123
1049
4afdf0f0c5bc remove unused JBuffer methods
Franklin Schmidt <fschmidt@gmail.com>
parents: 1048
diff changeset
124 private int put(byte[] b, int offset, int length) {
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
125 ByteBuffer dup = bb.duplicate();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
126 int put = bb.limit();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
127 int capacity = bb.capacity();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
128 dup.position(put);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
129 dup.limit(capacity);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
130 if( length > capacity - put )
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
131 length = capacity - put;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
132 dup.put(b,offset,length);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
133 bb.limit(put+length);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
134 return length;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
135 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
136
1066
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
137 public void putQ(byte[] b) {
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
138 bb.put(b);
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
139 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
140
1066
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
141 public int put(byte[] b) {
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
142 return put(b,0,b.length);
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
143 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
144
1051
1ab2dd0a7db5 remove JBuffer.get(int)
Franklin Schmidt <fschmidt@gmail.com>
parents: 1050
diff changeset
145 public void skip(int n) {
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
146 if (remaining() < n) n = remaining();
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
147 bb.position(bb.position() + n);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
148 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
149
1060
957f758dcffc fix JBuffer.get()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1059
diff changeset
150 private final byte[] asArray() {
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
151 byte[] bytes = new byte[remaining()];
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
152 bb.duplicate().get(bytes);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
153 return bytes;
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
154 }
1064
a0abb16cf6e7 remove JBuffer.readFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1063
diff changeset
155 /*
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
156 @Override
1054
87275900646e remove JBuffer.toString()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1053
diff changeset
157 public String toString() {
87275900646e remove JBuffer.toString()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1053
diff changeset
158 // return toString("ISO-8859-1");
87275900646e remove JBuffer.toString()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1053
diff changeset
159 // Thread.dumpStack();
87275900646e remove JBuffer.toString()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1053
diff changeset
160 throw new RuntimeException("toString");
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
161 }
1064
a0abb16cf6e7 remove JBuffer.readFrom()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1063
diff changeset
162 */
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
163
1052
4a2489f1d5fe remove JBuffer.peek()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1051
diff changeset
164 public byte get(int index) {
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
165 return bb.get(index);
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
166 }
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
167
1066
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
168 public void flip() {
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
169 bb.flip();
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
170 }
bbbda7c6e8ec fix use of HttpGenerator._header
Franklin Schmidt <fschmidt@gmail.com>
parents: 1065
diff changeset
171
1046
a8c92b0a08ed add JBuffer
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
172 }