mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 16:34:51 +01:00
Save Compression Update
This commit is contained in:
@@ -70,10 +70,15 @@ func Compress(rawData []byte) ([]byte, error) {
|
|||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
output = append(output, []byte{byte(nullCount)}...)
|
output = append(output, []byte{byte(nullCount)}...)
|
||||||
break
|
break
|
||||||
} else if i != 0 {
|
} else if i != 0 && nullCount != 0 {
|
||||||
r.UnreadByte()
|
r.UnreadByte()
|
||||||
output = append(output, []byte{byte(nullCount)}...)
|
output = append(output, []byte{byte(nullCount)}...)
|
||||||
break
|
break
|
||||||
|
} else if i != 0 && nullCount == 0 {
|
||||||
|
r.UnreadByte()
|
||||||
|
output = output[:len(output)-2]
|
||||||
|
output = append(output, []byte{byte(0xFF)}...)
|
||||||
|
break
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user