org.fcrepo.utilities.io.NullInputStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fcrepo-common Show documentation
Show all versions of fcrepo-common Show documentation
Common, generally useful utilities
/* The contents of this file are subject to the license and copyright terms
* detailed in the license directory at the root of the source tree (also
* available online at http://fedora-commons.org/license/).
*/
package org.fcrepo.utilities.io;
import java.io.IOException;
import java.io.InputStream;
/**
* CXF needs a non-null entity to preserve content-type and content-length
* as per 2.7.7
* @author [email protected]
*
*/
public class NullInputStream extends InputStream {
public static final NullInputStream NULL_STREAM =
new NullInputStream();
@Override
public int read() throws IOException {
return -1;
}
@Override
public long skip(long n) {
return n;
}
}