Skip to content

Commit c565d2e

Browse files
committed
Passing atFirstRecord down to UncompressedARCReader seems to work.
1 parent b45ea54 commit c565d2e

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/main/java/org/archive/io/arc/ARCReaderFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected ArchiveReader getArchiveReader(final String arc,
151151
if (compressed) {
152152
return new CompressedARCReader(arc, possiblyWrapped, atFirstRecord);
153153
} else {
154-
return new UncompressedARCReader(arc, possiblyWrapped);
154+
return new UncompressedARCReader(arc, possiblyWrapped, atFirstRecord);
155155
}
156156
}
157157

@@ -330,10 +330,11 @@ public UncompressedARCReader(final File f, final long offset)
330330
* @param f Uncompressed arc to read.
331331
* @param is InputStream.
332332
*/
333-
public UncompressedARCReader(final String f, final InputStream is) {
333+
public UncompressedARCReader(final String f, final InputStream is, boolean atFirstRecord) {
334334
// Arc file has been tested for existence by time it has come
335335
// to here.
336336
setIn(new CountingInputStream(is));
337+
setAlignedOnFirstRecord(atFirstRecord);
337338
initialize(f);
338339
}
339340
}

src/test/java/org/archive/io/arc/ARCReaderFactoryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public class ARCReaderFactoryTest extends TestCase {
2828
* @throws Exception
2929
*/
3030
public void testGetResource() throws Exception {
31-
this.offsetResourceTest(testfile1, 1515, "archive.org/robots.txt" );
32-
this.offsetResourceTest(testfile1, 36420, "archive.org/services/collection-rss.php" );
31+
this.offsetResourceTest(testfile1, 1515, "http://www.archive.org/robots.txt" );
32+
this.offsetResourceTest(testfile1, 36420, "http://www.archive.org/services/collection-rss.php" );
3333
}
3434

3535
private void offsetResourceTest( File testfile, long offset, String uri ) throws Exception {

0 commit comments

Comments
 (0)