diff src/org/eclipse/jetty/io/JBuffer.java @ 1064:a0abb16cf6e7

remove JBuffer.readFrom()
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 09 Nov 2016 03:09:37 -0700
parents 0157e92670f5
children 158d1e6ac17f
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/JBuffer.java	Wed Nov 09 02:08:33 2016 -0700
+++ b/src/org/eclipse/jetty/io/JBuffer.java	Wed Nov 09 03:09:37 2016 -0700
@@ -5,8 +5,6 @@
 import java.io.InputStream;
 import java.io.IOException;
 import java.nio.ByteBuffer;
-import java.nio.channels.Channels;
-import java.nio.channels.ReadableByteChannel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.eclipse.jetty.util.TypeUtil;
@@ -144,33 +142,19 @@
 		bb.position(bb.position() + n);
 	}
 
-	public int readFrom(InputStream in,int max) throws IOException {
-		ByteBuffer dup = bb.duplicate();
-		int put = bb.limit();
-		dup.limit( Math.min(put+max,bb.capacity()) );
-		dup.position(put);
-
-		ReadableByteChannel chan = Channels.newChannel(in);
-		int n = chan.read(dup);
-
-		if( n > 0 )
-			bb.limit(put+n);
-		return n;
-	}
-
 	private final byte[] asArray() {
 		byte[] bytes = new byte[remaining()];
 		bb.duplicate().get(bytes);
 		return bytes;
 	}
-
+/*
 	@Override
 	public String toString() {
 //		return toString("ISO-8859-1");
 //		Thread.dumpStack();
 		throw new RuntimeException("toString");
 	}
-
+*/
 
 	public byte get(int index) {
 		return bb.get(index);