public class CopyInputStreamBuffer extends FilterInputStream
in| Constructor and Description |
|---|
CopyInputStreamBuffer(InputStream inputStream,
File tempFile)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
closeCompleteStream()
Close the original stream and the copy (which will deleted)
|
InputStream |
getInputStream()
Returns copied input stream
|
static File |
getTempFile(String tempDir,
String filePrefix,
String fileSuffix)
Create a temporary file.
|
boolean |
isClosed()
Indicate whether the stream was closed
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
available, mark, markSupported, reset, skippublic CopyInputStreamBuffer(InputStream inputStream, File tempFile) throws FileNotFoundException
inputStream - The input stream to copytempFile - The file to copy the stream toFileNotFoundException - in case the temporary file does not existpublic static File getTempFile(String tempDir, String filePrefix, String fileSuffix) throws IOException
tempDir - Path to temp directoryfilePrefix - Prefix string of temp filefileSuffix - Suffix string of temp fileIOException - Threw when a file does not createdpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterInputStreamIOExceptionpublic void closeCompleteStream()
public InputStream getInputStream() throws IOException
IOException - Thrown when an exception occurredpublic boolean isClosed()
true when the stream was already closedpublic int read()
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class FilterInputStreamIOExceptionCopyright © 2019 Communote team. All rights reserved.