• NeonSDK
  • NeonKUBE
Search Results for

    Show / Hide Table of Contents
    • Neon
      • Build
    • Neon.Blazor
      • BlazorHelper
      • BodyOutlet
      • ClientRenderContext
      • DOMRectReadOnly
      • EventHandlers
      • FileDownloader
      • HtmlElement
      • IRenderContext
      • IntersectionChangedEventArgs
      • IntersectionObserver
      • IntersectionObserverContext
      • MobileDetector
      • NeonBlazorExtensions
      • ServerRenderContext
      • SwipeDirection
      • SwipeHandler
    • Neon.Blazor.Analyzers
      • SvgGenerator
      • SvgGenerator.Svg
    • Neon.BuildInfo
      • ThisAssembly
      • ThisAssembly.Git
      • ThisAssembly.Git.BaseVersion
      • ThisAssembly.Git.SemVer
    • Neon.CSharp
      • CSharpHelper
      • CompilerErrorException
      • MetadataReferences
    • Neon.Cassandra
      • KeyspaceStatus
      • RowSetExtensions
      • SchemaManager
      • SchemaManagerException
      • SchemaStatus
      • SessionExtensions
    • Neon.Collections
      • ArgDictionary
      • Bits
      • IObjectDictionary
      • NiceDictionary<TKey, TValue>
      • ObjectDictionary
    • Neon.Common
      • AppDomainExtensions
      • Block
      • BlockArray
      • ByteEncoding
      • ByteUnits
      • CommandLine
      • CommandLine.OptionDefinition
      • CommandLine.Redactor
      • CpuArchitecture
      • Credentials
      • DateTimeExtensions
      • EnumExtensions
      • EnvironmentParser
      • EnvironmentParser.Parser<T>
      • EnvironmentParser.Validator<T>
      • EnvironmentParser.VariableSource
      • ExceptionExtensions
      • ExecuteException
      • ExecuteResponse
      • GlobPattern
      • HexDumpOption
      • HttpClientExtensions
      • HttpResponseMessageExtensions
      • IEnumerableExtensions
      • ILabeled
      • IOExtensions
      • IServiceContainer
      • IStaticDirectoryExtensions
      • LabelSelector
      • LabelSelectorOptions
      • LabelSelector<TItem>
      • NeonAssemblyExtensions
      • NeonExtendedHelper
      • NeonHelper
      • NetFramework
      • NewtonsoftExtensions
      • NotReadyException
      • ProcessExtensions
      • ProgramEntrypoint
      • ProgramEntrypointAsync
      • ProgramExitException
      • ProgramRunner
      • RandomExtensions
      • ReflectionExtensions
      • SemanticVersion
      • ServiceContainer
      • StaticZipOptions
      • StringBuilderExtensions
      • StringExtensions
      • Stub
      • Stub.Value
      • TaskExtensions
      • TimeSpanExtensions
      • ToolException
      • TriState
      • WeakEventController
      • WindowsEdition
      • WindowsFeatureStatus
      • YamlDotNetExtensions
    • Neon.Cryptography
      • AesCipher
      • CryptoExtensions
      • CryptoHelper
      • NeonVault
      • Wildcard
    • Neon.Csv
      • CsvReader
      • CsvTableReader
      • CsvTableWriter
      • CsvWriter
    • Neon.Data
      • DateTimeJsonConverter
      • DateTimeOffsetJsonConverter
      • IEnhancedJsonConverter
      • IGeneratedServiceClient
      • IPersistableType
      • IPersistableType<T>
      • IRoundtripData
      • IntegerEnumConverter<TEnum>
      • NotifyPropertyChanged
      • RoundtripDataFactory
      • RoundtripDataHelper
      • TimeSpanJsonConverter
      • VersionJsonConverter
    • Neon.Deployment
      • AwsCli
      • DeploymentException
      • DeploymentHelper
      • DownloadManifest
      • DownloadPart
      • DownloadProgressDelegate
      • DownloadProgressType
      • GitHub
      • GitHubActionsApi
      • GitHubPackage
      • GitHubPackageApi
      • GitHubPackageType
      • GitHubPackageVersion
      • GitHubPackageVisibility
      • GitHubReleaseApi
      • GitHubRepoPath
      • GitHubTagApi
      • IProfileClient
      • IProfileRequest
      • IProfileResponse
      • MaintainerProfile
      • NotifyClient
      • OnePassword
      • OnePasswordException
      • ProfileException
      • ProfileHandlerResult
      • ProfileRequest
      • ProfileResponse
      • ProfileServer
      • ProfileStatus
      • XenServer
    • Neon.Deployment.CodeSigning
      • AzureProfile
      • CodeSigner
      • UsbTokenProfile
    • Neon.Diagnostics
      • AssertException
      • ConfigExtensions
      • ConsoleJsonLogExporter
      • ConsoleJsonLogExporterOptions
      • ConsoleTextLogExporter
      • ConsoleTextLogExporterOptions
      • ExceptionInfo
      • FileLogExporter
      • FileLogExporterFormat
      • FileLogExporterOptions
      • LogAsTraceProcessor
      • LogAsTraceProcessorOptions
      • LogAttributeNames
      • LogAttributes
      • LogEvent
      • LogEventInterceptor
      • LoggerExtensions
      • NullLogger
      • TelemetryHub
      • TelemetrySpanEventNames
      • TelemetrySpanExtensions
    • Neon.Docker
      • DockerClient
      • DockerNetwork
      • DockerNetworkContainer
      • DockerNetworkIpam
      • DockerNode
      • DockerNodeManagerStatus
      • DockerResponse
      • DockerSettings
      • DockerVolume
      • NetworkCreateResponse
      • ServiceBindOptions
      • ServiceConfig
      • ServiceContainerSpec
      • ServiceCredentialSpec
      • ServiceDetails
      • ServiceDiscreteResourceSpec
      • ServiceDnsConfig
      • ServiceEndpoint
      • ServiceEndpointMode
      • ServiceEndpointPortConfig
      • ServiceEndpointSpec
      • ServiceFile
      • ServiceGenericResources
      • ServiceGlobalSchedulingMode
      • ServiceHealthCheck
      • ServiceIsolationMode
      • ServiceListResponse
      • ServiceLogDriver
      • ServiceMode
      • ServiceMount
      • ServiceMountBindPropagation
      • ServiceMountConsistency
      • ServiceMountType
      • ServiceNamedResourceSpec
      • ServiceNetwork
      • ServicePlacement
      • ServicePlacementPreferences
      • ServicePlacementSpreadSettings
      • ServicePlatform
      • ServicePortMode
      • ServicePortProtocol
      • ServicePrivileges
      • ServiceReplicatedSchedulingMode
      • ServiceResourceSettings
      • ServiceResources
      • ServiceRestartCondition
      • ServiceRestartPolicy
      • ServiceRollbackConfig
      • ServiceRollbackFailureAction
      • ServiceRollbackOrder
      • ServiceSELinuxContext
      • ServiceSchedulingMode
      • ServiceSecret
      • ServiceSpec
      • ServiceTaskTemplate
      • ServiceTmpfsOptions
      • ServiceUpdateConfig
      • ServiceUpdateFailureAction
      • ServiceUpdateOrder
      • ServiceUpdateState
      • ServiceUpdateStatus
      • ServiceVersion
      • ServiceVirtualIP
      • ServiceVolumeDriverConfig
      • ServiceVolumeOptions
      • VolumeListResponse
    • Neon.GitHub
      • GitExtensions
      • GitHubCredentials
      • GitHubRepo
      • LocalRepoApi
      • NoLocalRepositoryException
      • RemoteRepoApi
      • RemoteRepoBranchApi
      • RemoteRepoIssueApi
      • RemoteRepoIssueCommentApi
      • RemoteRepoPath
      • RemoteRepoReleaseApi
      • RemoteRepoTagApi
    • Neon.HyperV
      • HyperVClient
      • HyperVDriverType
      • HyperVException
      • NetAdapter
      • VirtualDrive
      • VirtualIPAddress
      • VirtualMachine
      • VirtualMachineNetworkAdapter
      • VirtualMachineState
      • VirtualNat
      • VirtualSwitch
      • VirtualSwitchType
    • Neon.IO
      • BlockStream
      • FixedLengthStream
      • IStaticDirectory
      • IStaticFile
      • LineEnding
      • LinuxPath
      • LinuxPermissions
      • PreprocessReader
      • RelayStream
      • StaticDirectoryBase
      • StaticFileBase
      • SubStream
      • TempFile
      • TempFolder
    • Neon.JsonConverters
      • JsonDateTimeConverter
      • JsonGenericConverter<T>
      • JsonNullableDateTimeConverter
    • Neon.ModelGen
      • ActionResult<T>
      • ApiVersion
      • ApiVersionAttribute
      • BodyStreamAttribute
      • ControllerValidationAttribute
      • DataModelAttribute
      • EnumMember
      • FromBodyAttribute
      • FromHeaderAttribute
      • FromQueryAttribute
      • FromRouteAttribute
      • GeneratedClientAttribute
      • GeneratedMethodAttribute
      • GeneratedParamAttribute
      • HashSourceAttribute
      • HttpAttribute
      • HttpDeleteAttribute
      • HttpGetAttribute
      • HttpHeadAttribute
      • HttpOptionsAttribute
      • HttpPatchAttribute
      • HttpPostAttribute
      • HttpPutAttribute
      • IActionResult
      • ModelGenerator
      • ModelGeneratorOutput
      • ModelGeneratorSettings
      • NoCodeGenAttribute
      • NoControllerValidationAttribute
      • PassAs
      • PersistableAttribute
      • PersistableKeyAttribute
      • RouteAttribute
      • ServiceModelAttribute
      • TargetAttribute
      • UxFrameworks
    • Neon.Net
      • HttpApiException
      • HttpException
      • JsonClient
      • JsonClientPayload
      • JsonResponse
      • Jwt
      • LocalHostSection
      • NetConst
      • NetHelper
      • NetworkCidr
      • NetworkConfiguration
      • NetworkException
      • NetworkPorts
      • Pinger
      • ReachableHost
      • ReachableHostMode
      • StreamDocument
    • Neon.Postgres
      • ConnectionExtensions
      • DatabaseStatus
      • PreparedCommand
      • ReaderAsyncEnumerator
      • ReaderEnumerator
      • ReaderExtensions
      • SchemaManager
      • SchemaManagerException
      • SchemaStatus
    • Neon.Retry
      • ExponentialRetryPolicy
      • IRetryPolicy
      • LinearRetryPolicy
      • NoRetryPolicy
      • RetryPolicy
      • RetryPolicyBase
      • RetryTransientArgs
      • TransientDetector
      • TransientException
    • Neon.Roslyn
      • DisplayFormat
      • DocumentationComment
      • DocumentationItem
      • MetadataLoadContext
      • RoslynAssembly
      • RoslynConstructorInfo
      • RoslynCustomAttributeData
      • RoslynExtensions
      • RoslynFieldInfo
      • RoslynMethodInfo
      • RoslynParameterInfo
      • RoslynPropertyInfo
      • RoslynType
      • SharedUtilities
    • Neon.Roslyn.Xunit
      • AdditionalSourceText
      • CompilationOptions
      • CompilationOptionsProvider
      • TestCompilation
      • TestCompilationAssertions
      • TestCompilationBuilder
      • TestCompilationBuilderExtensions
      • TestCompilationExtensions
    • Neon.SSH
      • CommandBundle
      • CommandFile
      • CommandResponse
      • HostFolders
      • IBashCommandFormatter
      • ILinuxSshProxy
      • LinuxDiskInfo
      • LinuxDiskPartition
      • LinuxSshProxy
      • LinuxSshProxy<TMetadata>
      • NamespaceDoc
      • RemoteCommandException
      • RunOptions
      • SshCredentials
      • SshExtensions
      • SshProxyException
    • Neon.Service
      • LogMetricsProcessor
      • MetricsMode
      • MetricsOptions
      • NeonService
      • NeonServiceOptions
      • NeonServiceStatus
      • OtelConfigExtensions
      • OtlpCollectorChecker
      • ProcessTerminator
      • ServiceApiContact
      • ServiceApiInfo
      • ServiceApiLicense
      • ServiceDependencies
      • ServiceDescription
      • ServiceEndpoint
      • ServiceEndpointProtocol
      • ServiceEndpoints
      • ServiceMap
    • Neon.SignalR
      • DependencyInjectionExtensions
      • DnsCache
      • GroupAction
      • GroupCommand
      • IDnsCache
      • Invocation
      • NatsHubLifetimeManager<THub>
      • ProxyConfig
      • ServiceCollectionExtensions
      • ServiceDiscovey
      • SignalrProxyMiddleware
      • SignalrProxyMiddlewareExtensions
      • TracerProviderBuilderExtensions
    • Neon.Tailwind
      • ClickOffEventHandler
      • ComponentEventArgs<TSender>
      • ComponentEventArgs<TSender, TEventArgs>
      • DisclosureState
      • EventHandlerComponentBase<TComponent>
      • HeadlessButton
      • HeadlessDialog
      • HeadlessDialogPanel
      • HeadlessDisclosure
      • HeadlessDisclosureButton
      • HeadlessDisclosurePanel
      • HeadlessListboxButton<TValue>
      • HeadlessListboxLabel<TValue>
      • HeadlessListboxOption<TValue>
      • HeadlessListboxOptions<TValue>
      • HeadlessListbox<TValue>
      • HeadlessMenu
      • HeadlessMenuButton
      • HeadlessMenuItem
      • HeadlessMenuItems
      • HeadlessSwitch
      • HeadlessSwitchGroup
      • HeadlessSwitchLabel
      • IPortalBinder
      • KeyDownEventHandler
      • KeyboardKey
      • ListboxFocus
      • ListboxState
      • MenuFocus
      • MenuState
      • Portal
      • PortalBinder
      • PortalContent
      • SearchAssistant
      • TailwindExtensions
      • Transition
      • TransitionGroup
      • TransitionState
    • Neon.Tasks
      • Async
      • AsyncAutoResetEvent
      • AsyncManualResetEvent
      • AsyncMutex
      • AsyncPeriodicTask
      • AsyncReaderWriterLock
      • AsyncReentrantMutex
      • AsyncTimer
      • IAsyncFuture
      • IAsyncFuture<T>
      • NonDisposableTask
      • NonDisposableTask<T>
      • SyncContext
      • SyncContextMode
    • Neon.Temporal
      • ActivityHelper
      • ActivityLogEnricher
      • TemporalEnricherTagNames
      • WorkflowLogEnricher
    • Neon.Time
      • GatedTimer
      • GoDuration
      • PolledTimer
      • RecurringTimer
      • RecurringTimerType
      • SysTime
      • TimeOfDay
    • Neon.WSL
      • Wsl2Proxy
    • Neon.Web
      • AesProtector
      • DataProtectionExtensions
      • NeonController
      • NeonControllerBase
      • RoundTripJsonInputFormatter
      • RoundTripJsonOutputFormatter
      • TracerProviderBuilderExtensions
      • WebHelper
    • Neon.WinTTY
      • ConsoleTTY
    • Neon.Windows
      • MEMORYSTATUSEX
      • PowerShellException
      • Win32
    • Neon.XenServer
      • IXenClient
      • XenClient
      • XenClient.MachineOperations
      • XenClient.StorageOperations
      • XenClient.TemplateOperations
      • XenException
      • XenHostInfo
      • XenObject
      • XenResponse
      • XenStorageRepository
      • XenTempIso
      • XenTemplate
      • XenVirtualDisk
      • XenVirtualMachine
      • XenVmPowerState
    • Neon.Xunit
      • AnsiblePlayResults
      • AnsiblePlayer
      • AnsibleTaskResult
      • AspNetFixture
      • BasicFixture
      • CodeFixture
      • CollectionComparer<T>
      • ComposedFixture
      • ContainerFixture
      • ContainerLimits
      • DockerComposeFixture
      • DockerFixture
      • DockerFixture.ConfigInfo
      • DockerFixture.ContainerInfo
      • DockerFixture.NetworkInfo
      • DockerFixture.SecretInfo
      • DockerFixture.ServiceInfo
      • DockerFixture.StackDefinition
      • DockerFixture.StackInfo
      • DockerFixture.StackService
      • EnvironmentFixture
      • HostsFixture
      • ITestFixture
      • IncompatibleServiceException
      • MaintainerFactAttribute
      • MaintainerTheoryAttribute
      • MockHttpServer
      • MockHttpServerExtensions
      • NatsFixture
      • NatsStreamingFixture
      • NeonServiceFixture<TService>
      • PlatformFactAttribute
      • RepeatAttribute
      • TargetPlatforms
      • TestArea
      • TestCollection
      • TestContext
      • TestFixture
      • TestFixtureStatus
      • TestHelper
      • TestHttpClient
      • TestOutputWriter
      • TestTrait
      • XunitExtensions
    • Neon.Xunit.YugaByte
      • YugaByteFixture
    • Neon.YugaByte
      • YugaByteHelper

    Class BlockArray

    Implements an array of Block instances.

    Inheritance
    object
    BlockArray
    Namespace: Neon.Common
    Assembly: Neon.Common.dll
    Syntax
    public sealed class BlockArray
    Remarks

    The purpose of BlockArray is to avoid performance robbing buffer reallocations and copies and large obvject heap applications as can happen with extensive use of the MemoryStream class. Rather than doing I/O to a single large buffer, the BlockArray provides the underlying functionality for spreading I/O across multiple blocks. This avoids any need to reallocate and copy a large buffer as the stream grows an also tends to allocate consistently sized memory blocks, making life easier for the memory allocator.

    This class is pretty flexible. Blocks can be explicitly added and removed from the class or the ExtendTo(int), TruncateTo(int), or SetExactSize(int) methods can be used have the class handle block management.

    The BlockSize and BlockOffset properties are used by the internal block management methods when allocating new blocks. BlockSize defaults to 512 and specifies the size of new blocks. BlockOffset defaults to 0. New blocks will have their Offset field set to BlockOffset.

    BlockOffset provides for some tricky performance optimizations. A common situation in network protocols is the need to fragment serialized data across multiple data packets with fixed sized headers. Setting BlockOffset to the size of the fixed header will reserve these bytes at the beginning of each block. The data can be serialized into the array and then afterwards, the headers can be written manually into each block. This technique can avoid lots of buffer copying.

    note

    You should call Reload() after directly modifying the Length or Offset properties of any of the blocks in the array. It is not necessary to call this for changes to the Block.Buffer array.

    Constructors

    BlockArray()

    Constructs an empty list.

    Declaration
    public BlockArray()

    BlockArray(params Block[])

    Constructs an array from the blocks passed.

    Declaration
    public BlockArray(params Block[] blocks)
    Parameters
    Type Name Description
    Block[] blocks

    The blocks.

    BlockArray(byte[])

    Constructs a block array from a buffer.

    Declaration
    public BlockArray(byte[] buffer)
    Parameters
    Type Name Description
    byte[] buffer

    The buffer to append.

    BlockArray(int)

    Constructs an array with the specified capacity.

    Declaration
    public BlockArray(int capacity)
    Parameters
    Type Name Description
    int capacity

    The capacity in bytes.

    BlockArray(int, int)

    Constructs an array with the specified capacity and block size.

    Declaration
    public BlockArray(int capacity, int blockSize)
    Parameters
    Type Name Description
    int capacity

    The capacity in bytes.

    int blockSize

    Size of blocks added when extending the array.

    BlockArray(int, int, int)

    Constructs an array with the specified capacity, block size, and block offset.

    Declaration
    public BlockArray(int capacity, int blockSize, int blockOffset)
    Parameters
    Type Name Description
    int capacity

    The capacity in bytes.

    int blockSize

    Size of blocks added when extending the array.

    int blockOffset

    Bytes to be reserved at the beginning of each new block.

    Properties

    BlockOffset

    The default offset to use when adding new blocks to the array.

    Declaration
    public int BlockOffset { get; set; }
    Property Value
    Type Description
    int

    BlockSize

    The size of new blocks added when extending the array.

    Declaration
    public int BlockSize { get; set; }
    Property Value
    Type Description
    int

    Count

    Returns the number of blocks in the list.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    this[int]

    Accesses the indexed byte in the logical array formed by concatentating all of the blocks.

    Declaration
    public byte this[int index] { get; set; }
    Parameters
    Type Name Description
    int index
    Property Value
    Type Description
    byte

    Size

    Returns the total size of all the blocks in bytes.

    Declaration
    public int Size { get; }
    Property Value
    Type Description
    int

    Methods

    Append(Block)

    Appends a block to end of the array.

    Declaration
    public void Append(Block block)
    Parameters
    Type Name Description
    Block block

    The new block.

    Append(BlockArray)

    Appends all blocks from a block array to this array.

    Declaration
    public void Append(BlockArray blocks)
    Parameters
    Type Name Description
    BlockArray blocks

    The source array.

    Append(BlockArray, int, int)

    Appends blocks from a block array to this array.

    Declaration
    public void Append(BlockArray blocks, int index, int count)
    Parameters
    Type Name Description
    BlockArray blocks

    The source array.

    int index

    Index of the first block to append.

    int count

    Number of blocks to append.

    Append(byte[])

    Appends a block formed by a buffer to the array.

    Declaration
    public void Append(byte[] buffer)
    Parameters
    Type Name Description
    byte[] buffer

    The buffer to add.

    Clone()

    Returns a shallow copy of the block array.

    Declaration
    public BlockArray Clone()
    Returns
    Type Description
    BlockArray

    The cloned array.

    Remarks

    A new set of Block objects will be returned but they will point to the same underlying buffers.

    CopyFrom(byte[], int, int, int)

    Copies bytes from the byte array passed into the blocks.

    Declaration
    public void CopyFrom(byte[] source, int sourceOffset, int targetOffset, int length)
    Parameters
    Type Name Description
    byte[] source

    The source byte array.

    int sourceOffset

    Offset of the first byte to copy from the source array.

    int targetOffset

    Logical offset of the first target byte in the buffer references.

    int length

    Number of bytes to copy.

    CopyTo(int, byte[], int, int)

    Copies bytes from the logical offset in the blocks to the target byte array.

    Declaration
    public void CopyTo(int sourceOffset, byte[] target, int targetOffset, int length)
    Parameters
    Type Name Description
    int sourceOffset

    Logical offset of the first byte to copy.

    byte[] target

    The output byte array.

    int targetOffset

    Target offset where the first byte is to be written.

    int length

    The number of bytes to copy.

    ExtendTo(int)

    Adds blocks to the array as necessary to ensure that the total size of these blocks is at least equal to the value passed.

    Declaration
    public void ExtendTo(int capacity)
    Parameters
    Type Name Description
    int capacity

    The minimum requested capacity in bytes.

    Extract(int)

    Extracts a range of bytes from the array from the specified index to the end of the array into newly created block array.

    Declaration
    public BlockArray Extract(int index)
    Parameters
    Type Name Description
    int index

    Logical index of the first byte.

    Returns
    Type Description
    BlockArray

    A new block array referencing the bytes.

    Remarks
    note

    Although this method does create a new BlockArray and Block objects, it does not copy the underlying buffers. Instead, it adjusts the new Block objects to reference the requested portions of the original underlying buffers.

    Extract(int, int)

    Extracts a range of bytes from the array into newly created block array.

    Declaration
    public BlockArray Extract(int index, int length)
    Parameters
    Type Name Description
    int index

    Logical index of the first byte.

    int length

    Number of bytes to extract.

    Returns
    Type Description
    BlockArray

    A new block array referencing the bytes.

    Remarks
    note

    Although this method does create a new BlockArray and Block objects, it does not copy the underlying buffers. Instead, it adjusts the new Block objects to reference the requested portions of the original underlying buffers.

    GetBlock(int)

    Returns the indexed block in the list.

    Declaration
    public Block GetBlock(int index)
    Parameters
    Type Name Description
    int index

    The index (0..Count-1).

    Returns
    Type Description
    Block

    The block.

    GetBlocks()

    Returns an array to the underlying blocks.

    Declaration
    public Block[] GetBlocks()
    Returns
    Type Description
    Block[]

    The block array.

    Reload()

    Reloads cached information about the blocks in the array.

    Declaration
    public void Reload()
    Remarks

    This should be called after making changes to the Length property of any blocks in the array.

    Reset()

    Used internally by unit tests to reset any internal positional optimization information maintained by the class.

    Declaration
    public void Reset()

    SetExactSize(int)

    Adjusts the blocks in the array such that their sizes total exactly to the value passed.

    Declaration
    public void SetExactSize(int capacity)
    Parameters
    Type Name Description
    int capacity

    The desired size.

    Remarks

    The method removes or appends blocks onto the end of the array to reach the desired size. The method will also adjust the length of the final block if necessary.

    ToByteArray()

    Assembles the blocks referenced by the array into a contiguous byte array.

    Declaration
    public byte[] ToByteArray()
    Returns
    Type Description
    byte[]

    A contiguous byte array.

    TruncateTo(int)

    Removes blocks from the and of the array array such that only those blocks necessary to achieve the specified capacity remain.

    Declaration
    public void TruncateTo(int capacity)
    Parameters
    Type Name Description
    int capacity

    The desired capacity in bytes.

    Remarks

    The method does nothing if the requested capacity is larger than the current size of the blocks.

    Operators

    implicit operator BlockArray(Block[])

    Implicit cast from and array of Blocks into a BlockArray.

    Declaration
    public static implicit operator BlockArray(Block[] blocks)
    Parameters
    Type Name Description
    Block[] blocks

    The array of blocks to be converted.

    Returns
    Type Description
    BlockArray

    The BlockArray.

    In this article
    Back to top © Copyright 2005-2023 by NEONFORGE LLC