Repository navigation
Read and write the binary formats as byte slices - #37
Merged
Merged
Conversation
A generated type writes its WKB and EWKB as a []byte and reads them from one, the length carried by the slice, as the catalog's shape states the buffer: a size_t * the shape lists in outParams is the length of the buffer the call answers, so it leaves the signature, and a uint8_t array it lists in inputArrays is taken as a []byte whose length fills the parameter the shape names. Temporal.AsWKB(variant) answers a []byte, TemporalFromWKB(wkb []byte) and TGeomPointFromEWKB(wkb []byte) read one, and the hex writers, AsHexWKB and AsHexEWKB, answer their string with no size to pass. The flat layer's TakeBytes copies the buffer MEOS answers into Go memory and frees MEOS's, as every wrapper answering a char * frees it once C.GoString has copied it: 149 methods take the forms, 134 of them a []byte. Examples are named Example_<suffix> where the identifier they show is the generated package's, as go vet reads an example's name. Measured: the 128 root examples pass under TZ=UTC, a temporal point written as EWKB and read back from the bytes writing the same bytes; the functions, types and root packages build with no go vet finding, and the parity tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A generated type writes its WKB and EWKB as a []byte and reads them from
one, the length carried by the slice, as the catalog's shape states the
buffer: a size_t * the shape lists in outParams is the length of the
buffer the call answers, so it leaves the signature, and a uint8_t array
it lists in inputArrays is taken as a []byte whose length fills the
parameter the shape names. Temporal.AsWKB(variant) answers a []byte,
TemporalFromWKB(wkb []byte) and TGeomPointFromEWKB(wkb []byte) read one,
and the hex writers, AsHexWKB and AsHexEWKB, answer their string with no
size to pass. The flat layer's TakeBytes copies the buffer MEOS answers
into Go memory and frees MEOS's, as every wrapper answering a char *
frees it once C.GoString has copied it: 149 methods take the forms, 134
of them a []byte.
Examples are named Example_ where the identifier they show is
the generated package's, as go vet reads an example's name.
Measured: the 128 root examples pass under TZ=UTC, a temporal point
written as EWKB and read back from the bytes writing the same bytes; the
functions, types and root packages build with no go vet finding, and the
parity tests pass.