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 intprivate RandomAccessFileprivate Stringprivate 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 voidassertAllSplitFilesExist(File[] allSortedSplitFiles) voidclose()longlonglength()voidprivate voidopenRandomAccessFileForIndex(int splitCounter) intread()intread(byte[] b) intread(byte[] b, int off, int len) voidseek(long pos) voidseekInCurrentPart(long pos) voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) Methods inherited from class 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:
readin classRandomAccessFile- Throws:
IOException
-
read
- Overrides:
readin classRandomAccessFile- Throws:
IOException
-
read
- Overrides:
readin classRandomAccessFile- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classRandomAccessFile- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classRandomAccessFile- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classRandomAccessFile- Throws:
IOException
-
seek
- Overrides:
seekin classRandomAccessFile- Throws:
IOException
-
getFilePointer
- Overrides:
getFilePointerin classRandomAccessFile- Throws:
IOException
-
length
- Overrides:
lengthin classRandomAccessFile- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classRandomAccessFile- Throws:
IOException
-
seekInCurrentPart
- Throws:
IOException
-
openLastSplitFileForReading
- Throws:
IOException
-
openRandomAccessFileForIndex
- Throws:
IOException
-
assertAllSplitFilesExist
- Throws:
IOException
-