Class PieceMapperImpl
- java.lang.Object
-
- com.biglybt.core.disk.impl.piecemapper.impl.PieceMapperImpl
-
- All Implemented Interfaces:
DMPieceMapper
public class PieceMapperImpl extends java.lang.Object implements DMPieceMapper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
PieceMapperImpl.fileInfo
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<PieceMapperImpl.fileInfo>
btFileList
private int
last_piece_length
private TOTorrent
torrent
-
Constructor Summary
Constructors Constructor Description PieceMapperImpl(TOTorrent _torrent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
buildFileLookupTable(TOTorrentFile torrent_file, LocaleUtilDecoder locale_decoder, char separator)
Builds the path stored in fileDictionay, saving it in btFileListprivate void
buildFileLookupTables(TOTorrentFile[] torrent_files, LocaleUtilDecoder locale_decoder)
private void
buildFileLookupTables(TOTorrentFile torrent_file, java.lang.String fileName)
private java.util.List<PieceMapEntryImpl>
buildLastPieceToFileList(java.util.List<PieceMapperImpl.fileInfo> file_list, int current_file, long file_offset)
void
construct(LocaleUtilDecoder _locale_decoder, java.lang.String _save_name)
DMPieceMapperFile[]
getFiles()
int
getLastPieceLength()
int
getPieceLength()
DMPieceMap
getPieceMap()
long
getTotalLength()
-
-
-
Field Detail
-
torrent
private final TOTorrent torrent
-
last_piece_length
private final int last_piece_length
-
btFileList
protected final java.util.ArrayList<PieceMapperImpl.fileInfo> btFileList
-
-
Constructor Detail
-
PieceMapperImpl
public PieceMapperImpl(TOTorrent _torrent)
-
-
Method Detail
-
construct
public void construct(LocaleUtilDecoder _locale_decoder, java.lang.String _save_name) throws java.io.UnsupportedEncodingException
- Specified by:
construct
in interfaceDMPieceMapper
- Throws:
java.io.UnsupportedEncodingException
-
buildFileLookupTables
private void buildFileLookupTables(TOTorrentFile torrent_file, java.lang.String fileName)
-
buildFileLookupTables
private void buildFileLookupTables(TOTorrentFile[] torrent_files, LocaleUtilDecoder locale_decoder) throws java.io.UnsupportedEncodingException
- Throws:
java.io.UnsupportedEncodingException
-
buildFileLookupTable
private void buildFileLookupTable(TOTorrentFile torrent_file, LocaleUtilDecoder locale_decoder, char separator) throws java.io.UnsupportedEncodingException
Builds the path stored in fileDictionay, saving it in btFileList- Parameters:
fileDictionay
-btFileList
-localeUtil
-separator
-- Throws:
java.io.UnsupportedEncodingException
-
getPieceMap
public DMPieceMap getPieceMap()
- Specified by:
getPieceMap
in interfaceDMPieceMapper
-
buildLastPieceToFileList
private java.util.List<PieceMapEntryImpl> buildLastPieceToFileList(java.util.List<PieceMapperImpl.fileInfo> file_list, int current_file, long file_offset)
-
getTotalLength
public long getTotalLength()
- Specified by:
getTotalLength
in interfaceDMPieceMapper
-
getPieceLength
public int getPieceLength()
- Specified by:
getPieceLength
in interfaceDMPieceMapper
-
getLastPieceLength
public int getLastPieceLength()
- Specified by:
getLastPieceLength
in interfaceDMPieceMapper
-
getFiles
public DMPieceMapperFile[] getFiles()
- Specified by:
getFiles
in interfaceDMPieceMapper
-
-