Home | History | Annotate | Download | only in dec

Lines Matching refs:handle

23 /* Obtain handle from opaque pointer. */
47 DecoderHandle* handle = nullptr;
52 handle = new (std::nothrow) DecoderHandle();
53 ok = !!handle;
56 handle->input_offset = 0;
57 handle->input_length = 0;
58 handle->input_start = nullptr;
63 handle->input_start = new (std::nothrow) uint8_t[input_size];
64 ok = !!handle->input_start;
69 handle->state = BrotliDecoderCreateInstance(nullptr, nullptr, nullptr);
70 ok = !!handle->state;
75 might require thread-safe cookie<->handle mapping. */
76 context[0] = reinterpret_cast<jlong>(handle);
77 } else if (!!handle) {
78 if (!!handle->input_start) delete[] handle->input_start;
79 delete handle;
88 return env->NewDirectByteBuffer(handle->input_start, input_size);
110 DecoderHandle* handle = getHandle(reinterpret_cast<void*>(context[0]));
116 if (handle->input_offset < handle->input_length) {
119 handle->input_offset = 0;
120 handle->input_length = input_length;
124 const uint8_t* in = handle->input_start + handle->input_offset;
125 size_t in_size = handle->input_length - handle->input_offset;
128 handle->state, &in_size, &in, &out_size, nullptr, nullptr);
129 handle->input_offset = handle->input_length - in_size;
133 context[1] = (handle->input_offset == handle->input_length) ? 1 : 0;
163 DecoderHandle* handle = getHandle(reinterpret_cast<void*>(context[0]));
165 const uint8_t* data = BrotliDecoderTakeOutput(handle->state, &data_length);
166 if (BrotliDecoderHasMoreOutput(handle->state)) {
168 } else if (BrotliDecoderIsFinished(handle->state)) {
170 context[1] = (handle->input_offset == handle->input_length) ? 1 : 0;
173 context[1] = (handle->input_offset == handle->input_length) ? 2 : 4;
189 DecoderHandle* handle = getHandle(reinterpret_cast<void*>(context[0]));
190 BrotliDecoderDestroyInstance(handle->state);
191 delete[] handle->input_start;
192 delete handle;