jdk/src/share/classes/javax/sound/sampled/DataLine.java
changeset 25144 e2bf17cee34b
parent 25128 2dfdfa369071
parent 24969 afa6934dd8e8
child 26003 d630c97424bd
equal deleted inserted replaced
25143:aade36e70da0 25144:e2bf17cee34b
   468          * @return a string description
   468          * @return a string description
   469          */
   469          */
   470         @Override
   470         @Override
   471         public String toString() {
   471         public String toString() {
   472 
   472 
   473             StringBuffer buf = new StringBuffer();
   473             StringBuilder sb = new StringBuilder();
   474 
   474 
   475             if ( (formats.length == 1) && (formats[0] != null) ) {
   475             if ( (formats.length == 1) && (formats[0] != null) ) {
   476                 buf.append(" supporting format " + formats[0]);
   476                 sb.append(" supporting format " + formats[0]);
   477             } else if (getFormats().length > 1) {
   477             } else if (getFormats().length > 1) {
   478                 buf.append(" supporting " + getFormats().length + " audio formats");
   478                 sb.append(" supporting " + getFormats().length + " audio formats");
   479             }
   479             }
   480 
   480 
   481             if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) {
   481             if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) {
   482                 buf.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes");
   482                 sb.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes");
   483             } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) {
   483             } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) {
   484                 buf.append(", and buffers of at least " + minBufferSize + " bytes");
   484                 sb.append(", and buffers of at least " + minBufferSize + " bytes");
   485             } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) {
   485             } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) {
   486                 buf.append(", and buffers of up to " + minBufferSize + " bytes");
   486                 sb.append(", and buffers of up to " + minBufferSize + " bytes");
   487             }
   487             }
   488 
   488 
   489             return new String(super.toString() + buf);
   489             return new String(super.toString() + sb);
   490         }
   490         }
   491     }
   491     }
   492 }
   492 }