Package net.lingala.zip4j.io.inputstream
Class NumberedSplitRandomAccessFile
- java.lang.Object
-
- java.io.RandomAccessFile
-
- net.lingala.zip4j.io.inputstream.NumberedSplitRandomAccessFile
-
- All Implemented Interfaces:
Closeable
,DataInput
,DataOutput
,AutoCloseable
public class NumberedSplitRandomAccessFile extends RandomAccessFile
A RandomAccessFile which reads files split with 7-zip format (.z001, .z002, etc) as a single file making it easier for calling methods to deal with opening appropriate split file to read
-
-
Constructor Summary
Constructors Constructor Description NumberedSplitRandomAccessFile(File file, String mode)
NumberedSplitRandomAccessFile(File file, String mode, File[] allSortedSplitFiles)
NumberedSplitRandomAccessFile(String name, String mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
long
getFilePointer()
long
length()
void
openLastSplitFileForReading()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
seek(long pos)
void
seekInCurrentPart(long pos)
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(int b)
-
Methods inherited from class java.io.RandomAccessFile
getChannel, getFD, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, setLength, skipBytes, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
-
-
-
Constructor Detail
-
NumberedSplitRandomAccessFile
public NumberedSplitRandomAccessFile(String name, String mode) throws IOException
- Throws:
IOException
-
NumberedSplitRandomAccessFile
public NumberedSplitRandomAccessFile(File file, String mode) throws IOException
- Throws:
IOException
-
NumberedSplitRandomAccessFile
public NumberedSplitRandomAccessFile(File file, String mode, File[] allSortedSplitFiles) throws IOException
- Throws:
IOException
-
-
Method Detail
-
read
public int read() throws IOException
- Overrides:
read
in classRandomAccessFile
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classRandomAccessFile
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classRandomAccessFile
- Throws:
IOException
-
write
public void write(int b) throws IOException
- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classRandomAccessFile
- Throws:
IOException
-
write
public void write(byte[] b) throws IOException
- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classRandomAccessFile
- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException
- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classRandomAccessFile
- Throws:
IOException
-
seek
public void seek(long pos) throws IOException
- Overrides:
seek
in classRandomAccessFile
- Throws:
IOException
-
getFilePointer
public long getFilePointer() throws IOException
- Overrides:
getFilePointer
in classRandomAccessFile
- Throws:
IOException
-
length
public long length() throws IOException
- Overrides:
length
in classRandomAccessFile
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classRandomAccessFile
- Throws:
IOException
-
seekInCurrentPart
public void seekInCurrentPart(long pos) throws IOException
- Throws:
IOException
-
openLastSplitFileForReading
public void openLastSplitFileForReading() throws IOException
- Throws:
IOException
-
-