Mercurial Hosting > luan
diff src/org/eclipse/jetty/io/JBuffer.java @ 1073:6e511ea557b4
remove old JBuffer.put()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 10 Nov 2016 02:33:09 -0700 |
parents | 00704b28b9f1 |
children | 6b7ff30bb990 |
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/JBuffer.java Thu Nov 10 02:29:01 2016 -0700 +++ b/src/org/eclipse/jetty/io/JBuffer.java Thu Nov 10 02:33:09 2016 -0700 @@ -95,49 +95,14 @@ bb.put(src.bb); } - public int put(JBuffer src) { - return put(src.asArray()); - } - public void putQ(byte b) { bb.put(b); } - public void put(byte b) - { - ByteBuffer dup = bb.duplicate(); - dup.position(bb.limit()); - dup.limit(bb.capacity()); - dup.put(b); - bb.limit(bb.limit()+1); - } - - private int put(byte[] b, int offset, int length) { - ByteBuffer dup = bb.duplicate(); - int put = bb.limit(); - int capacity = bb.capacity(); - dup.position(put); - dup.limit(capacity); - if( length > capacity - put ) - length = capacity - put; - dup.put(b,offset,length); - bb.limit(put+length); - return length; - } - public void putQ(byte[] b) { bb.put(b); } - public int put(byte[] b) { - return put(b,0,b.length); - } - - private final byte[] asArray() { - byte[] bytes = new byte[remaining()]; - bb.duplicate().get(bytes); - return bytes; - } /* @Override public String toString() {