ARTEMIS-2785 removed unused and leak-prone readBytes method

This commit is contained in:
Francesco Nigro 2020-05-29 18:43:21 +02:00
parent c72b226bfb
commit 99c819b776
4 changed files with 0 additions and 35 deletions

View File

@ -799,19 +799,6 @@ public interface ActiveMQBuffer extends DataInput {
@Override
String readUTF();
/**
* Transfers this buffer's data to a newly created buffer starting at
* the current {@code readerIndex} and increases the {@code readerIndex}
* by the number of the transferred bytes (= {@code length}).
* The returned buffer's {@code readerIndex} and {@code writerIndex} are
* {@code 0} and {@code length} respectively.
*
* @param length the number of bytes to transfer
* @return the newly created buffer which contains the transferred bytes
* @throws IndexOutOfBoundsException if {@code length} is greater than {@code this.readableBytes}
*/
ActiveMQBuffer readBytes(int length);
/**
* Returns a new slice of this buffer's sub-region starting at the current
* {@code readerIndex} and increases the {@code readerIndex} by the size

View File

@ -330,11 +330,6 @@ public class ChannelBufferWrapper implements ActiveMQBuffer {
buffer.readBytes(dst.byteBuf());
}
@Override
public ActiveMQBuffer readBytes(final int length) {
return new ChannelBufferWrapper(buffer.readBytes(length), releasable);
}
@Override
public char readChar() {
return (char) buffer.readShort();

View File

@ -24,7 +24,6 @@ import java.nio.ByteBuffer;
import io.netty.buffer.ByteBuf;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
@ -592,13 +591,6 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
return Float.intBitsToFloat(getInt(index));
}
@Override
public ActiveMQBuffer readBytes(final int length) {
byte[] bytesToGet = new byte[length];
readBytes(bytesToGet);
return ActiveMQBuffers.wrappedBuffer(bytesToGet);
}
@Override
public double readDouble() {
return Double.longBitsToDouble(readLong());

View File

@ -31,7 +31,6 @@ import java.util.concurrent.TimeUnit;
import io.netty.buffer.ByteBuf;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
import org.apache.activemq.artemis.api.core.ActiveMQInterruptedException;
@ -975,14 +974,6 @@ public class LargeMessageControllerImpl implements LargeMessageController {
return Float.intBitsToFloat(getInt(index));
}
@Override
public ActiveMQBuffer readBytes(final int length) {
byte[] bytesToGet = new byte[length];
getBytes(readerIndex, bytesToGet);
readerIndex += length;
return ActiveMQBuffers.wrappedBuffer(bytesToGet);
}
@Override
public double readDouble() {
return Double.longBitsToDouble(readLong());