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
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate File[]
private int
private RandomAccessFile
private String
private byte[]
private long
-
Constructor Summary
ConstructorsConstructorDescriptionNumberedSplitRandomAccessFile
(File file, String mode) NumberedSplitRandomAccessFile
(File file, String mode, File[] allSortedSplitFiles) NumberedSplitRandomAccessFile
(String name, String mode) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
assertAllSplitFilesExist
(File[] allSortedSplitFiles) void
close()
long
long
length()
void
private void
openRandomAccessFileForIndex
(int splitCounter) 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
-
Field Details
-
splitLength
private long splitLength -
allSortedSplitFiles
-
randomAccessFile
-
singleByteBuffer
private byte[] singleByteBuffer -
currentOpenSplitFileCounter
private int currentOpenSplitFileCounter -
rwMode
-
-
Constructor Details
-
NumberedSplitRandomAccessFile
- Throws:
IOException
-
NumberedSplitRandomAccessFile
- Throws:
IOException
-
NumberedSplitRandomAccessFile
public NumberedSplitRandomAccessFile(File file, String mode, File[] allSortedSplitFiles) throws IOException - Throws:
IOException
-
-
Method Details
-
read
- Overrides:
read
in classRandomAccessFile
- Throws:
IOException
-
read
- Overrides:
read
in classRandomAccessFile
- Throws:
IOException
-
read
- Overrides:
read
in classRandomAccessFile
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classRandomAccessFile
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classRandomAccessFile
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classRandomAccessFile
- Throws:
IOException
-
seek
- Overrides:
seek
in classRandomAccessFile
- Throws:
IOException
-
getFilePointer
- Overrides:
getFilePointer
in classRandomAccessFile
- Throws:
IOException
-
length
- Overrides:
length
in classRandomAccessFile
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classRandomAccessFile
- Throws:
IOException
-
seekInCurrentPart
- Throws:
IOException
-
openLastSplitFileForReading
- Throws:
IOException
-
openRandomAccessFileForIndex
- Throws:
IOException
-
assertAllSplitFilesExist
- Throws:
IOException
-