Example usage for org.springframework.util StreamUtils emptyInput

List of usage examples for org.springframework.util StreamUtils emptyInput

Introduction

In this page you can find the example usage for org.springframework.util StreamUtils emptyInput.

Prototype

public static InputStream emptyInput() 

Source Link

Document

Return an efficient empty InputStream .

Usage

From source file:org.springframework.web.multipart.commons.CommonsMultipartFile.java

@Override
public InputStream getInputStream() throws IOException {
    if (!isAvailable()) {
        throw new IllegalStateException("File has been moved - cannot be read again");
    }/*from w w  w  . j  a  v  a  2 s .  c  o  m*/
    InputStream inputStream = this.fileItem.getInputStream();
    return (inputStream != null ? inputStream : StreamUtils.emptyInput());
}