|
|
|
|
|
|
|
|
package org.eclipse.jgit.pgm; |
|
|
package org.eclipse.jgit.pgm; |
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertArrayEquals; |
|
|
import static org.junit.Assert.assertArrayEquals; |
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
import static org.junit.Assert.fail; |
|
|
import static org.junit.Assert.fail; |
|
|
import static org.junit.Assume.assumeNoException; |
|
|
import static org.junit.Assume.assumeNoException; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BufferedInputStream in = new BufferedInputStream( |
|
|
BufferedInputStream in = new BufferedInputStream( |
|
|
new FileInputStream(file)); |
|
|
new FileInputStream(file)); |
|
|
try { |
|
|
try { |
|
|
in.skip(offset); |
|
|
|
|
|
|
|
|
if (offset > 0) { |
|
|
|
|
|
long skipped = in.skip(offset); |
|
|
|
|
|
assertEquals(offset, skipped); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
byte[] actual = new byte[magicBytes.length]; |
|
|
byte[] actual = new byte[magicBytes.length]; |
|
|
in.read(actual); |
|
|
in.read(actual); |