FileDocCategorySizeDatePackage
RandomAccessFileInputstream.javaAPI DocJaudiotagger 2.0.41728Wed Mar 30 16:11:50 BST 2011org.jaudiotagger.audio.asf.io

RandomAccessFileInputstream

public final class RandomAccessFileInputstream extends InputStream
Wraps a {@link RandomAccessFile} into an {@link InputStream}.
author
Christian Laireiter

Fields Summary
private final RandomAccessFile
source
The file access to read from.
Constructors Summary
public RandomAccessFileInputstream(RandomAccessFile file)
Creates an instance that will provide {@link InputStream} functionality on the given {@link RandomAccessFile} by delegating calls.

param
file The file to read.

        super();
        if (file == null) {
            throw new IllegalArgumentException("null");
        }
        this.source = file;
    
Methods Summary
public intread()
{@inheritDoc}

        return this.source.read();
    
public intread(byte[] buffer, int off, int len)
{@inheritDoc}

        return this.source.read(buffer, off, len);
    
public longskip(long amount)
{@inheritDoc}

        if (amount < 0) {
            throw new IllegalArgumentException("invalid negative value");
        }
        long left = amount;
        while (left > Integer.MAX_VALUE) {
            this.source.skipBytes(Integer.MAX_VALUE);
            left -= Integer.MAX_VALUE;
        }
        return this.source.skipBytes((int) left);