VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsPacketWriter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Public buffer As String

Public Sub Clear()
    buffer = vbNullString
End Sub

Public Sub InsertByte(ByRef value As Byte)
    buffer = buffer & Chr$(value)
End Sub

Public Sub InsertByteArray(ParamArray value())
    Dim I As Integer
    For I = 0 To UBound(value)
        buffer = buffer & Chr$(CByte(value(I)))
    Next I
End Sub

Public Sub InsertInt16(ByRef value As Integer)
    buffer = buffer & CreateInt16(value)
End Sub

Public Sub InsertInt16Array(ParamArray value())
    Dim I As Integer
    For I = 0 To UBound(value)
        buffer = buffer & CreateInt16(CInt(value(I)))
    Next I
End Sub

Public Sub InsertInt32(ByRef value As Long)
    buffer = buffer & CreateInt32(value)
End Sub

Public Sub InsertInt64(ByRef value As Currency)
    buffer = buffer & CreateInt64(value)
End Sub

Public Sub InsertInt32Array(ParamArray value())
    Dim I As Integer
    For I = 0 To UBound(value)
        buffer = buffer & CreateInt32(CLng(value(I)))
    Next I
End Sub

Public Sub InsertFixedString(ByRef value As String)
    buffer = buffer & value
End Sub

Public Sub InsertCString(ByRef value As String)
    buffer = buffer & value & vbNullChar
End Sub
