Better names and messages.
MODIFY
src/main/java/org/apache/commons/io/input/QueueInputStream.java
src/main/java/org/apache/commons/io/input/QueueInputStream.java
*/
public class QueueInputStream extends InputStream {
- private final BlockingQueue<Integer> queue;
+ private final BlockingQueue<Integer> blockingQueue;
/**
* Constructs a new instance with no limit to its internal buffer size.
@@ -67,10 +67,10 @@ public QueueInputStream() {
/**
* Constructs a new instance with given buffer
*
- * @param queue backing queue for the stream
+ * @param blockingQueue backing queue for the stream
*/
- public QueueInputStream(final BlockingQueue<Integer> queue) {
- this.queue = Objects.requireNonNull(queue, "queue is required");
+ public QueueInputStream(final BlockingQueue<Integer> blockingQueue) {
+ this.blockingQueue = Objects.requireNonNull(blockingQueue, "blockingQueue");
}
/**
@@ -80,7 +80,7 @@ public QueueInputStream(final BlockingQueue<Integer> queue) {
* @return QueueOutputStream connected to this stream
*/
public QueueOutputStream newQueueOutputStream() {
- return new QueueOutputStream(queue);
+ return new QueueOutputStream(blockingQueue);
}
/**
@@ -90,7 +90,7 @@ public QueueOutputStream newQueueOutputStream() {
*/
@Override
public int read() {
- final Integer value = queue.poll();
+ final Integer value = blockingQueue.poll();
return value == null ? -1 : ((0xFF) & value);
}

MODIFY
src/main/java/org/apache/commons/io/output/QueueOutputStream.java
src/main/java/org/apache/commons/io/output/QueueOutputStream.java
*/
public class QueueOutputStream extends OutputStream {
- private final BlockingQueue<Integer> queue;
+ private final BlockingQueue<Integer> blockingQueue;
/**
* Constructs a new instance with no limit to internal buffer size.
@@ -66,10 +66,10 @@ public QueueOutputStream() {
/**
* Constructs a new instance with given buffer.
*
- * @param queue backing queue for the stream
+ * @param blockingQueue backing queue for the stream
*/
- public QueueOutputStream(final BlockingQueue<Integer> queue) {
- this.queue = Objects.requireNonNull(queue, "queue is required");
+ public QueueOutputStream(final BlockingQueue<Integer> blockingQueue) {
+ this.blockingQueue = Objects.requireNonNull(blockingQueue, "blockingQueue");
}
/**
@@ -79,7 +79,7 @@ public QueueOutputStream(final BlockingQueue<Integer> queue) {
* @return QueueInputStream connected to this stream
*/
public QueueInputStream newQueueInputStream() {
- return new QueueInputStream(queue);
+ return new QueueInputStream(blockingQueue);
}
/**
@@ -90,7 +90,7 @@ public QueueInputStream newQueueInputStream() {
@Override
public void write(final int b) throws InterruptedIOException {
try {
- queue.put(0xFF & b);
+ blockingQueue.put(0xFF & b);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
final InterruptedIOException interruptedIoException = new InterruptedIOException();

Better names and messages.