/** * Reconstitutes the Queue instance from a stream (that is, * deserializes it). * * @param s the stream */ private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); for (;;) { @SuppressWarnings("unchecked") E item = (E) s.readObject(); if (item == null) break; else offer(item); } }
/** * Reconstitutes the Queue instance from a stream (that is, * deserializes it). * * @param s the stream */ private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); for (;;) { @SuppressWarnings("unchecked") E item = (E) s.readObject(); if (item == null) break; else offer(item); } }
@Override public void run() { for (; ; ) { if (queue.offer("A")) { putCount++; } } } }.start();
@Override public void run() { while (true) { transferQueue.offer(testData); } } }.start();