Show / Hide Table of Contents

Class PendingBuffer

This class is general purpose class for writing data to a buffer.

It allows you to write bits as well as bytes Based on DeflaterPending.java

author of the original java version : Jochen Hoenicke

Inheritance
System.Object
PendingBuffer
DeflaterPending
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ICSharpCode.SharpZipLib.Zip.Compression
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public class PendingBuffer

Constructors

| Improve this Doc View Source

PendingBuffer()

construct instance using default buffer size of 4096

Declaration
public PendingBuffer()
| Improve this Doc View Source

PendingBuffer(Int32)

construct instance using specified buffer size

Declaration
public PendingBuffer(int bufferSize)
Parameters
Type Name Description
System.Int32 bufferSize

size to use for internal buffer

Properties

| Improve this Doc View Source

BitCount

The number of bits written to the buffer

Declaration
public int BitCount { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

IsFlushed

Indicates if buffer has been flushed

Declaration
public bool IsFlushed { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

AlignToByte()

Align internal buffer on a byte boundary

Declaration
public void AlignToByte()
| Improve this Doc View Source

Flush(Byte[], Int32, Int32)

Flushes the pending buffer into the given output array. If the output array is to small, only a partial flush is done.

Declaration
public int Flush(byte[] output, int offset, int length)
Parameters
Type Name Description
System.Byte[] output

The output array.

System.Int32 offset

The offset into output array.

System.Int32 length

The maximum number of bytes to store.

Returns
Type Description
System.Int32

The number of bytes flushed.

| Improve this Doc View Source

Reset()

Clear internal state/buffers

Declaration
public void Reset()
| Improve this Doc View Source

ToByteArray()

Convert internal buffer to byte array. Buffer is empty on completion

Declaration
public byte[] ToByteArray()
Returns
Type Description
System.Byte[]

The internal buffer contents converted to a byte array.

| Improve this Doc View Source

WriteBits(Int32, Int32)

Write bits to internal buffer

Declaration
public void WriteBits(int b, int count)
Parameters
Type Name Description
System.Int32 b

source of bits

System.Int32 count

number of bits to write

| Improve this Doc View Source

WriteBlock(Byte[], Int32, Int32)

Write a block of data to buffer

Declaration
public void WriteBlock(byte[] block, int offset, int length)
Parameters
Type Name Description
System.Byte[] block

data to write

System.Int32 offset

offset of first byte to write

System.Int32 length

number of bytes to write

| Improve this Doc View Source

WriteByte(Int32)

Write a byte to buffer

Declaration
public void WriteByte(int value)
Parameters
Type Name Description
System.Int32 value

The value to write

| Improve this Doc View Source

WriteInt(Int32)

write an integer LSB first

Declaration
public void WriteInt(int value)
Parameters
Type Name Description
System.Int32 value

The value to write.

| Improve this Doc View Source

WriteShort(Int32)

Write a short value to buffer LSB first

Declaration
public void WriteShort(int value)
Parameters
Type Name Description
System.Int32 value

The value to write.

| Improve this Doc View Source

WriteShortMSB(Int32)

Write a short value to internal buffer most significant byte first

Declaration
public void WriteShortMSB(int s)
Parameters
Type Name Description
System.Int32 s

value to write

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2000-2022 SharpZipLib Contributors