Lines Matching refs:buffer
111 size_t write(void* buffer, size_t offset, const String8& value) {
112 memcpy(static_cast<char*>(buffer) + offset, value.string(), value.length());
117 size_t write(void* buffer, size_t offset, float value) {
118 *reinterpret_cast<float*>(static_cast<char*>(buffer) + offset) = value;
123 size_t write(void* buffer, size_t offset, int32_t value) {
124 *reinterpret_cast<int32_t*>(static_cast<char*>(buffer) + offset) = value;
128 status_t Sensor::flatten(void* buffer) const
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, mVersion);
136 offset += write(buffer, offset, mHandle);
137 offset += write(buffer, offset, mType);
138 offset += write(buffer, offset, mMinValue);
139 offset += write(buffer, offset, mMaxValue);
140 offset += write(buffer, offset, mResolution);
141 offset += write(buffer, offset, mPower);
142 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)
168 offset += read(buffer, offset, &len);
169 offset += read(buffer, offset, &mName, len);
170 offset += read(buffer, offset, &len);
171 offset += read(buffer, offset, &mVendor, len);
172 offset += read(buffer, offset, &mVersion);
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);