@Override
		public int read(byte[] b, int off, int len) throws IOException {
			if (!fetchBytesFromQueue(true)) {
				return -1;
			}

			int length = Math.min(bytes.length - position, len);
			System.arraycopy(bytes, position, b, off, length);
			position += length;
			return length;
		}
An {@link InputStream} that has as its source text strings being pushed into
it by a thread, and being read by another thread.
<p>
Not thread-safe for multiple readers, but is thread-safe for writers.
<p>
{@link #close() Closing} this stream (from any thread) will awaken the
blocked reader thread and give an EOF result to the read operation it was blocking on.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/interpreter/InterpreterPanel.java