Mercurial Hosting > luan
diff src/org/eclipse/jetty/io/JBuffer.java @ 1049:4afdf0f0c5bc
remove unused JBuffer methods
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 07 Nov 2016 23:34:48 -0700 |
parents | 2b769da7f67d |
children | 5ef954fad97b |
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/JBuffer.java Mon Nov 07 23:15:42 2016 -0700 +++ b/src/org/eclipse/jetty/io/JBuffer.java Mon Nov 07 23:34:48 2016 -0700 @@ -56,10 +56,6 @@ return bb.capacity(); } - public boolean isDirect() { - return bb.isDirect(); - } - public ByteBuffer getByteBuffer() { @@ -81,10 +77,6 @@ return bb.capacity() - bb.limit(); } - public JBuffer buffer() { - return this; - } - public JBuffer get(int length) { ByteBuffer dup = bb.duplicate(); @@ -118,7 +110,7 @@ bb.limit(bb.limit()+1); } - public int put(byte[] b, int offset, int length) { + private int put(byte[] b, int offset, int length) { ByteBuffer dup = bb.duplicate(); int put = bb.limit(); int capacity = bb.capacity(); @@ -153,10 +145,6 @@ return n; } - public JBuffer slice() { - return duplicate(); - } - public final JBuffer sliceFrom(int index) { ByteBuffer dup = bb.duplicate(); dup.position(index); @@ -197,7 +185,7 @@ return new JBuffer(dup).toString(); } - public final String toString(String charset) + private final String toString(String charset) { byte[] bytes = asArray(); try @@ -211,39 +199,6 @@ } } - public String toDetailString() - { - StringBuilder buf = new StringBuilder(); - buf.append("["); - buf.append(super.hashCode()); - buf.append(","); - buf.append(this.buffer().hashCode()); - buf.append(",g="); - buf.append(getIndex()); - buf.append(",p="); - buf.append(putIndex()); - buf.append(",c="); - buf.append(capacity()); - buf.append("]={"); - int count = 0; - for (int i = getIndex(); i < putIndex(); i++) - { - byte b = peek(i); - TypeUtil.toHex(b,buf); - if (count++ == 50) - { - if (putIndex() - i > 20) - { - buf.append(" ... "); - i = putIndex() - 20; - } - } - } - buf.append('}'); - return buf.toString(); - } - - private JBuffer pokeBuffer(int index) { JBuffer dup = duplicate(); @@ -259,10 +214,6 @@ pokeBuffer(index).put(b); } - public int poke(int index, JBuffer src) { - return pokeBuffer(index).put(src); - } - private JBuffer peekBuffer(int index) { JBuffer dup = duplicate(); dup.setGetIndex(index); @@ -270,10 +221,6 @@ return dup; } - public int peek(int index, byte[] b, int offset, int length) { - return peekBuffer(index).get(b,offset,length); - } - public byte peek(int index) { return bb.get(index); }