/** * Closes the input stream and removes the temporary file if one was * created. * * @throws IOException */ public void close() throws IOException { closeStream(); super.close(); if (storeFile != null) { storeFile.delete(); } }
/** * "Rewinds" the stream to the beginning for rereading. * @throws IOException */ public void rewind() throws IOException { if (firstPass && readToEndOfStreamOnFirstRewind) { // Force read to end of stream to fill store with any // remaining bytes from original stream. while(read() != -1) { // empty loop } } closeStream(); if (storeOutputStream != null) { storeOutputStream.close(); storeOutputStream = null; } firstPass = false; boolean newStreamIsInMemory = (size < maxBytesInMemory); inputStream = newStreamIsInMemory ? new ByteArrayInputStream(byteBuffer) : new BufferedInputStream(new FileInputStream(storeFile)); }
/** * Closes the input stream and removes the temporary file if one was * created. * * @throws IOException */ public void close() throws IOException { closeStream(); super.close(); if (storeFile != null) { storeFile.delete(); } }
/** * Closes the input stream and removes the temporary file if one was * created. * * @throws IOException */ public void close() throws IOException { closeStream(); super.close(); if (storeFile != null) { storeFile.delete(); } }
/** * "Rewinds" the stream to the beginning for rereading. * @throws IOException */ public void rewind() throws IOException { if (firstPass && readToEndOfStreamOnFirstRewind) { // Force read to end of stream to fill store with any // remaining bytes from original stream. while(read() != -1) { // empty loop } } closeStream(); if (storeOutputStream != null) { storeOutputStream.close(); storeOutputStream = null; } firstPass = false; boolean newStreamIsInMemory = (size < maxBytesInMemory); inputStream = newStreamIsInMemory ? new ByteArrayInputStream(byteBuffer) : new BufferedInputStream(new FileInputStream(storeFile)); }
/** * "Rewinds" the stream to the beginning for rereading. * @throws IOException */ public void rewind() throws IOException { if (firstPass && readToEndOfStreamOnFirstRewind) { // Force read to end of stream to fill store with any // remaining bytes from original stream. while(read() != -1) { // empty loop } } closeStream(); if (storeOutputStream != null) { storeOutputStream.close(); storeOutputStream = null; } firstPass = false; boolean newStreamIsInMemory = (size < maxBytesInMemory); inputStream = newStreamIsInMemory ? new ByteArrayInputStream(byteBuffer) : new BufferedInputStream(new FileInputStream(storeFile)); }