CARVIEW |
Select Language
HTTP/2 200
date: Tue, 22 Jul 2025 21:07:58 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"1966e202d857165dfa7ed3df08d873f4"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=rbcRA9ztQqagpqvSyz2FlIDxfkPb8NrBb4vTkfi%2F1cVsoz6uYnoJknzAQDAwzVa5U9OVOhlqEodyhzZZKrPE%2BmhYyeuP0LohpdtzUsUExO9agPAm4PqLhZaN4oLaoeU42EB6uLSWqZTMNQEbiz06A3uOvZlteK8%2BhqcqmYs%2FlhDapg%2FtoebJnu8wggtGqmrB5yiG3oWzI5gaJiKtIMV96uSeova0kFcPHen6dUQ3KHG9BC6ao8Wh8YiNdcAGxRJYKcdpw0%2FfvOhuzJd29Xk1xg%3D%3D--k9%2FpTDMEMpD1sNSC--pQs4vBIBYXhMObK%2FSk9fIA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.502677307.1753218478; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 21:07:58 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 21:07:58 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: C91E:36131:13918D:198F41:687FFDAE
jBinary Methods · jDataView/jBinary Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 58
jBinary Methods
Ingvar Stepanyan edited this page Apr 8, 2014
·
6 revisions
-
read(type, offset = binary.tell())
: Read value of specified type. Ifoffset
given, read it from custom position, otherwise read it from current position and move pointer forward (streaming mode).
var firstInt = binary.read('uint32'); // uint32 value at offset 0
var secondInt = binary.read('uint32'); // following uint32 value at offset 4
var byteAtOffset100 = binary.read('uint8', 100); // uint8 value at custom position
var thirdInt = binary.read('uint32'); // third uint32 value at offset 8 (since read operation with custom position didn't move internal pointer)
-
readAll()
: Read entire data as value of type specified by'jBinary.all'
key in typeset. -
write(type, data, offset = binary.tell())
: Write value of specified type. Sameoffset
behavior.
binary.write('uint32', 1); // writing uint32 value of 1 at offset 0
binary.write('uint32', 2); // writing uint32 value of 2 at offset 4
binary.write('uint8', 0xff, 100); // writing uint8 value of 255 at offset 100
binary.write('uint32', 3); // writing uint32 value of 3 at offset 8
-
writeAll(data)
: Write entire data as value of type specified by'jBinary.all'
key in typeset.
-
tell()
: Return the current position.
var currentPos = binary.tell();
-
seek(position[, callback])
: Go toposition
; ifcallback
is given, execute it and return to the previous position.
binary.seek(100); // just went to offset 100
var intAt200 = binary.seek(200, function () { return this.binary.read('int32') }); // go to offset 200, get int32 value there and return back to offset 100
-
skip(count[, callback])
: Advance in the binary bycount
bytes; samecallback
behavior.
binary.skip(1); // just skip one byte we are not interested in
var intAfter8 = binary.skip(8, function () { return this.binary.read('int32') }); // go 8 bytes forward, get int32 value there and return back
-
slice(start, end, forceCopy = false)
: Returns sliced version of current binary with same type set. IfforceCopy
set to true, underlying jDataView will be created on copy of original data not linked to it.
var pointerSlice = binary.slice(10, 20); // now you can manipulate on this jBinary instance and all the changes will be mirrored to original binary's data, but with new bound check rules
var copySlice = binary.slice(10, 20, true); // now you can manipulate on this jBinary instance as on absolutely new one and any data changes will stay isolated from original binary
-
as(typeSet, modifyOriginal = false)
: Casts jBinary instance to giventypeSet
while pointing to the same data, pointers and methods as original instance; ifmodifyOriginal
set to true, original instance will be modified instead of being inherited.
var binary = someExternalBinary.as(TAR); // casting external jBinary instance with no or with irrelevant typeset to TAR typeSet object (any operations including both data and pointer manipulations will affect both instances).
You can’t perform that action at this time.