/** * {@inheritDoc} */ @Override public final void open(InputStream in) throws IOException { reader = ResourceUtils.getStreamReader(in, tempDir, TOP_TAIL_CAPACITY, false); // Force read of entire input stream to build reader and remove dependence on source input stream. final long readSize = reader.length(); // getting the size of a reader backed by a stream forces a stream read. if (readSize != size) { String resourceIdentifier = ""; if (getIdentifier() != null && getIdentifier().getUri() != null) { resourceIdentifier = getIdentifier().getUri().toString(); } log.warn("The tar entry " + resourceIdentifier + " states it is " + size + " in length, but reading it produced: " + readSize); size = readSize; } }
/** * {@inheritDoc} */ @Override public final void open(InputStream in) throws IOException { reader = ResourceUtils.getStreamReader(in, tempDir, TOP_TAIL_CAPACITY, false); // Force read of entire input stream to build reader and remove dependence on source input stream. final long readSize = reader.length(); // getting the size of a reader backed by a stream forces a stream read. if (readSize != size) { String resourceIdentifier = ""; if (getIdentifier() != null && getIdentifier().getUri() != null) { resourceIdentifier = getIdentifier().getUri().toString(); } log.warn("The tar entry " + resourceIdentifier + " states it is " + size + " in length, but reading it produced: " + readSize); size = readSize; } }