Documentation ¶
Index ¶
- func DecompressFileArchive(bs []byte) ([]byte, error)
- func DecryptFileArchive(bs []byte, key []byte) ([]byte, error)
- func FileArchiveLength(bs []byte) (int, error)
- type ArchiveCompression
- type CacheReader
- type FileEntry
- type FileGroupEntry
- type FileIndex
- func (fi *FileIndex) FindFileID(groupName, fileName string) (groupID int, fileID int, found bool)
- func (fi *FileIndex) FindGroup(groupName string) *FileGroupEntry
- func (fi *FileIndex) FindGroupID(groupName string) (groupID int, found bool)
- func (fi *FileIndex) NamedIndex() *NamedEntryIndex
- func (fi *FileIndex) Size() (size int)
- type FileIndexFlags
- type MultipartFile
- type NamedEntryIndex
- type ReadBuffer
- func (rb *ReadBuffer) Copy(n int) []byte
- func (rb *ReadBuffer) Get(n int) (bs []byte)
- func (rb *ReadBuffer) GetCString() (s string)
- func (rb *ReadBuffer) GetUint16() (val uint16)
- func (rb *ReadBuffer) GetUint16AsInt() (val int)
- func (rb *ReadBuffer) GetUint24() (val uint32)
- func (rb *ReadBuffer) GetUint24AsInt() (val int)
- func (rb *ReadBuffer) GetUint32() (val uint32)
- func (rb *ReadBuffer) GetUint32AsInt() (val int)
- func (rb *ReadBuffer) GetUint64() (val uint64)
- func (rb *ReadBuffer) GetUint8() (val uint8)
- func (rb *ReadBuffer) GetUint8AsInt() (val int)
- func (rb *ReadBuffer) Remaining() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecompressFileArchive ¶
func FileArchiveLength ¶
Types ¶
type ArchiveCompression ¶
type ArchiveCompression byte
const ( ArchiveCompressionNone ArchiveCompression = iota ArchiveCompressionBZIP ArchiveCompressionGZIP )
func (ArchiveCompression) AsByte ¶
func (c ArchiveCompression) AsByte() byte
func (ArchiveCompression) Check ¶
func (c ArchiveCompression) Check() error
func (ArchiveCompression) HeaderLength ¶
func (c ArchiveCompression) HeaderLength() int
type CacheReader ¶
type CacheReader struct {
// contains filtered or unexported fields
}
func NewCacheReader ¶
func NewCacheReader(index io.ReadSeeker, blocks io.ReadSeeker, fileType int) *CacheReader
type FileGroupEntry ¶
type FileGroupEntry struct { NameHash uint32 `json:"name"` Checksum uint32 `json:"checksum"` Revision uint32 `json:"revision"` Files []*FileEntry `json:"files"` }
func (*FileGroupEntry) FileIDs ¶
func (e *FileGroupEntry) FileIDs() []int
func (*FileGroupEntry) FindFileID ¶
func (e *FileGroupEntry) FindFileID(fileName string) (fileID int, found bool)
func (*FileGroupEntry) Size ¶
func (e *FileGroupEntry) Size() (size int)
type FileIndex ¶
type FileIndex struct { Revision uint32 `json:"revision"` Groups []*FileGroupEntry `json:"groups"` }
func DecodeFileIndex ¶
func (*FileIndex) FindFileID ¶
func (*FileIndex) FindGroup ¶
func (fi *FileIndex) FindGroup(groupName string) *FileGroupEntry
func (*FileIndex) FindGroupID ¶
func (*FileIndex) NamedIndex ¶
func (fi *FileIndex) NamedIndex() *NamedEntryIndex
type MultipartFile ¶
type MultipartFile struct {
Parts [][]byte
}
func DecodeFileGroup ¶
func DecodeFileGroup(bs []byte, size int) []*MultipartFile
func (*MultipartFile) Collapse ¶
func (f *MultipartFile) Collapse() []byte
func (*MultipartFile) CollapsedLength ¶
func (f *MultipartFile) CollapsedLength() (length int)
type NamedEntryIndex ¶
type NamedEntryIndex struct {
// contains filtered or unexported fields
}
func (*NamedEntryIndex) LookupFileID ¶
func (e *NamedEntryIndex) LookupFileID(groupName, fileName string) (groupID int, fileID int, exists bool)
func (*NamedEntryIndex) LookupGroupID ¶
func (e *NamedEntryIndex) LookupGroupID(groupName string) (groupID int, exists bool)
type ReadBuffer ¶
type ReadBuffer []byte
ReadBuffer provides reading of various binary types from byte slice. After reading a value, the underlying slice will be resliced so that unread bytes are next to be read.
func (*ReadBuffer) Copy ¶
func (rb *ReadBuffer) Copy(n int) []byte
Get returns a copy of the next n bytes and reslices the underlying buffer to be a view of the bytes there after. This method is similar to Get except it returns a copy of the bytes which makes it safe to do modifications to the elements.
func (*ReadBuffer) Get ¶
func (rb *ReadBuffer) Get(n int) (bs []byte)
Get returns a slice of the next N bytes and reslices the underlying buffer to be a view of the bytes after the read bytes. This method should be carefully used because changes to the elements in the returned slice will appear in this buffer and elsewhere.
func (*ReadBuffer) GetCString ¶
func (rb *ReadBuffer) GetCString() (s string)
GetCString returns a null terminated string. TODO(hadyn): Runescape uses a specific character set, need to implement that.
func (*ReadBuffer) GetUint16 ¶
func (rb *ReadBuffer) GetUint16() (val uint16)
func (*ReadBuffer) GetUint16AsInt ¶
func (rb *ReadBuffer) GetUint16AsInt() (val int)
func (*ReadBuffer) GetUint24 ¶
func (rb *ReadBuffer) GetUint24() (val uint32)
func (*ReadBuffer) GetUint24AsInt ¶
func (rb *ReadBuffer) GetUint24AsInt() (val int)
func (*ReadBuffer) GetUint32 ¶
func (rb *ReadBuffer) GetUint32() (val uint32)
func (*ReadBuffer) GetUint32AsInt ¶
func (rb *ReadBuffer) GetUint32AsInt() (val int)
func (*ReadBuffer) GetUint64 ¶
func (rb *ReadBuffer) GetUint64() (val uint64)
func (*ReadBuffer) GetUint8 ¶
func (rb *ReadBuffer) GetUint8() (val uint8)
func (*ReadBuffer) GetUint8AsInt ¶
func (rb *ReadBuffer) GetUint8AsInt() (val int)
func (*ReadBuffer) Remaining ¶
func (rb *ReadBuffer) Remaining() int
Remaining is an alias for the length of the underlying slice.