mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
Save Compression Update
This commit is contained in:
@@ -70,10 +70,15 @@ func Compress(rawData []byte) ([]byte, error) {
|
||||
if err == io.EOF {
|
||||
output = append(output, []byte{byte(nullCount)}...)
|
||||
break
|
||||
} else if i != 0 {
|
||||
} else if i != 0 && nullCount != 0 {
|
||||
r.UnreadByte()
|
||||
output = append(output, []byte{byte(nullCount)}...)
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -90,4 +95,4 @@ func Compress(rawData []byte) ([]byte, error) {
|
||||
}
|
||||
}
|
||||
return output, nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user