s&
About
The Project
infoAbout s&box mapRoadmap monitoringMetricsEngine startup and usage numbers
Updates
newspaperLatest News published_with_changesChangesRelease-by-release changelog
Games
Browse Games Discover Games
gamejamslive now

Game Jam III

Ends Fri 25 Sep
ThemeOne More Round

The jam is running. Build something, or play the entries.

£50,000
prizepool
View the jam
Workshop
Playable
sports_esportsGamesStandalone games and gamemodes
Assets
landscapeMaps view_in_arModels textureMaterials apparelClothing
appsEverythingEvery asset type in one list
Forum
Learn
Documentation
rocket_launchGetting Started docsDocumentation apiAPI Reference
Resources
schoolTutorials manage_searchCode Search
inputLog in with Steam
Api
Classes
ByteStream
chevron_left Classes
struct
ByteStream

Properties

data_objectLengthdata_objectPositiondata_objectReadRemainingdata_objectWritable

Methods

functionsCompressfunctionsDecompressfunctionsDisposefunctionsEnsureCanReadfunctionsEnsureCanWritefunctionsReadfunctionsReadArrayfunctionsReadObjectfunctionsToArrayfunctionsTryReadfunctionsWritefunctionsWriteArray

Static Methods

functionsCreatefunctionsCreateReader
ByteStream
Write and read bytes to a stream. This aims to be as allocation free as possible while also being as fast as possible.
struct Sandbox .
sealedSandbox.System

data_object Properties 4

Length
int
The total size of the data
Position
int
The current read or write position. Values are clamped to valid range.
ReadRemaining
int
Writable
bool
Is this stream writable?

functions Methods 12

Compress (compressionLevel)
ByteStream
Decompress ()
ByteStream
Dispose ()
EnsureCanRead (size)
Validates read bounds with overflow protection
EnsureCanWrite (size)
Ensures buffer can accommodate write with overflow protection
Read ()
T
Reads an unmanaged type
ReadArray (maxElements)
T[]
Returns an array of unmanaged types
ReadObject (objectType)
object
ToArray ()
Byte[]
Get the data as an array of bytes
TryRead (v)
bool
Try to read variable, return false if not enough data
Write (stream)
WriteArray (arr)

functions Static Methods 2

Create (size)
ByteStream
Create a writable byte stream
CreateReader (data)
ByteStream
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
Facepunch
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter