public long skipBytes(long n) throws IOException {
        if (input instanceof RandomAccessFile) {
            long total = 0;
            int expected = 0;
            int actual = 0;
            do {
                expected = (n-total) > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) (n-total);
                actual = ((RandomAccessFile) input).skipBytes(expected);    // RandomAccessFile::skipBytes supports int
                total = total + actual;
            } while (total < n && actual > 0);
            return total;
        } else if (input instanceof DataInputStream) {
            return ((DataInputStream) input).skip(n); // InputStream::skip supports long
        } else {
            throw new UnsupportedOperationException("Unknown Hollow Blob Input type");
        }
    }
@Test
    public void testSkipBytes() throws IOException {
        HollowBlobInput inStream = HollowBlobInput.modeBasedSelector(MemoryMode.ON_HEAP, mockBlob);
        assertEquals(1l, inStream.skipBytes(1));
        assertEquals(1, inStream.read());   // next byte read is 1
        assertEquals(2000, inStream.skipBytes(2000));   // successfully skips past end of file for FileInputStream

        HollowBlobInput inBuffer = HollowBlobInput.modeBasedSelector(MemoryMode.SHARED_MEMORY_LAZY, mockBlob);
        assertEquals(1l, inBuffer.skipBytes(1));
        assertEquals(1, inBuffer.read());   // next byte read is 1
        assertEquals(12, inBuffer.skipBytes(2000));   // stops at end of file for RandomAccessFile
    }