You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
304 B
20 lines
304 B
// +build !appengine |
|
|
|
package plist |
|
|
|
import ( |
|
"reflect" |
|
"unsafe" |
|
) |
|
|
|
func zeroCopy8BitString(buf []byte, off int, len int) string { |
|
if len == 0 { |
|
return "" |
|
} |
|
|
|
var s string |
|
hdr := (*reflect.StringHeader)(unsafe.Pointer(&s)) |
|
hdr.Data = uintptr(unsafe.Pointer(&buf[off])) |
|
hdr.Len = len |
|
return s |
|
}
|
|
|