String (int maxLength) { StringBuilder sb = new StringBuilder(); while (sb.length() < maxLength) { Character c = myPushBackQueue.peek(); if (c != null) { if (c.charValue() < 32) { break; } sb.append(myPushBackQueue.poll()); } else { c = myQueue.peek(); if (c == null || c.charValue() < 32) { break; } sb.append(myQueue.poll()); } } return sb.toString(); }