Lines Matching refs:buffer
107 size_t write(void* buffer, size_t offset, const String8& value) {
108 memcpy(static_cast<char*>(buffer) + offset, value.string(), value.length());
113 size_t write(void* buffer, size_t offset, float value) {
114 *reinterpret_cast<float*>(static_cast<char*>(buffer) + offset) = value;
119 size_t write(void* buffer, size_t offset, int32_t value) {
120 *reinterpret_cast<int32_t*>(static_cast<char*>(buffer) + offset) = value;
124 status_t Sensor::flatten(void* buffer, size_t size,
131 offset += write(buffer, offset, int32_t(mName.length()));
132 offset += write(buffer, offset, mName);
133 offset += write(buffer, offset, int32_t(mVendor.length()));
134 offset += write(buffer, offset, mVendor);
135 offset += write(buffer, offset, mHandle);
136 offset += write(buffer, offset, mType);
137 offset += write(buffer, offset, mMinValue);
138 offset += write(buffer, offset, mMaxValue);
139 offset += write(buffer, offset, mResolution);
140 offset += write(buffer, offset, mPower);
141 offset += write(buffer, offset, mMinDelay);
147 size_t read(void const* buffer, size_t offset, String8* value, int32_t len) {
148 value->setTo(static_cast<char const*>(buffer) + offset, len);
153 size_t read(void const* buffer, size_t offset, float* value) {
154 *value = *reinterpret_cast<float const*>(static_cast<char const*>(buffer) + offset);
159 size_t read(void const* buffer, size_t offset, int32_t* value) {
160 *value = *reinterpret_cast<int32_t const*>(static_cast<char const*>(buffer) + offset);
164 status_t Sensor::unflatten(void const* buffer, size_t size,
169 offset += read(buffer, offset, &len);
170 offset += read(buffer, offset, &mName, len);
171 offset += read(buffer, offset, &len);
172 offset += read(buffer, offset, &mVendor, len);
173 offset += read(buffer, offset, &mHandle);
174 offset += read(buffer, offset, &mType);
175 offset += read(buffer, offset, &mMinValue);
176 offset += read(buffer, offset, &mMaxValue);
177 offset += read(buffer, offset, &mResolution);
178 offset += read(buffer, offset, &mPower);
179 offset += read(buffer, offset, &mMinDelay);