/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }