// FIXME: implement properly func readFully(ips io.Reader, dest []byte, dofs int, length int) os.Error { for len > 0 { res := ips.read(dest, dofs, length) if res < 0 { return os.EOF } dofs += res length -= res } return nil }