public void write(byte[] data) {
        try {
            queuedPackets.put(data);
        } catch (InterruptedException e) {
            // Our queue isn't bounded, so put() can never block to be interrupted.
            throw new RuntimeException("Unexpected interrupt", e);
        }
    }