@Test public void writeIntsTest() throws Exception { byte[] intLongBuffer = new byte[8]; for (int b = 1; b < 10; b++) { System.out.println("b:" + b); @SuppressWarnings("unchecked") ByteBufferFactory[] bufferFactorys = new ByteBufferFactory[] { new HeapByteBufferFactory(), new DirectByteBufferFactory() }; for (ByteBufferFactory bf : bufferFactorys) { MultiAutoGrowingByteBufferBackedFiler filer = new MultiAutoGrowingByteBufferBackedFiler(b, b, bf); for (int i = 0; i < b * 4; i++) { System.out.println(b + " " + i + " " + bf); UIO.writeInt(filer, i, "", new byte[4]); filer.seek(i * 4); Assert.assertEquals(UIO.readInt(filer, "", intLongBuffer), i, "Boo " + i + " at " + b + " " + bf); } } } }
@Override public final void seek(long position) throws IOException { position(position); }
MultiAutoGrowingByteBufferBackedFiler implements IFiler { @Override public final void seek(long position) throws IOException { position(position); } }
MultiAutoGrowingByteBufferBackedFiler implements IFiler { @Override public final void seek(long position) throws IOException { position(position); } MultiAutoGrowingByteBufferBackedFiler(long initialBufferSegmentSize,
        long maxBufferSegmentSize,
        ByteBufferFactory byteBufferFactory); private  MultiAutoGrowingByteBufferBackedFiler(long maxBufferSegmentSize,
        ByteBufferFactory byteBufferFactory,
        ByteBufferBackedFiler[] filers,
        long length,
        int fShift,
        long fseekMask); }
MultiAutoGrowingByteBufferBackedFiler implements IFiler { @Override public final void seek(long position) throws IOException { position(position); } MultiAutoGrowingByteBufferBackedFiler(long initialBufferSegmentSize,
        long maxBufferSegmentSize,
        ByteBufferFactory byteBufferFactory); private  MultiAutoGrowingByteBufferBackedFiler(long maxBufferSegmentSize,
        ByteBufferFactory byteBufferFactory,
        ByteBufferBackedFiler[] filers,
        long length,
        int fShift,
        long fseekMask); MultiAutoGrowingByteBufferBackedFiler duplicateAll(); @Override final void seek(long position); @Override long skip(long skip); @Override long length(); @Override void setLength(long len); @Override long getFilePointer(); @Override void eof(); @Override int read(); @Override int read(byte[] b); @Override int read(byte[] b, int offset, int len); @Override void write(byte b); @Override void write(byte[] b, int offset, int len); @Override void close(); @Override void flush(boolean fsync); @Override Object lock(); }
MultiAutoGrowingByteBufferBackedFiler implements IFiler { @Override public final void seek(long position) throws IOException { position(position); } MultiAutoGrowingByteBufferBackedFiler(long initialBufferSegmentSize,
        long maxBufferSegmentSize,
        ByteBufferFactory byteBufferFactory); private  MultiAutoGrowingByteBufferBackedFiler(long maxBufferSegmentSize,
        ByteBufferFactory byteBufferFactory,
        ByteBufferBackedFiler[] filers,
        long length,
        int fShift,
        long fseekMask); MultiAutoGrowingByteBufferBackedFiler duplicateAll(); @Override final void seek(long position); @Override long skip(long skip); @Override long length(); @Override void setLength(long len); @Override long getFilePointer(); @Override void eof(); @Override int read(); @Override int read(byte[] b); @Override int read(byte[] b, int offset, int len); @Override void write(byte b); @Override void write(byte[] b, int offset, int len); @Override void close(); @Override void flush(boolean fsync); @Override Object lock(); static final long MAX_BUFFER_SEGMENT_SIZE; static long MAX_POSITION; }