Ignore:
Timestamp:
Feb 16, 2009, 4:26:24 PM (15 years ago)
Author:
イグトランス (egtra)
Message:

UTF8Encodingクラスをとりあえず使える状態に。ただし、BOM出力はまだ不可能。
(#231)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/System/IO/Stream.ab

    r609 r682  
    155155End Class
    156156
     157/*!
     158@brief 書き込みバイト数を記憶するヌルストリーム
     159Encoding関連で使用
     160@date 2009/02/16
     161@auther Egtra
     162*/
     163Class WriteCountingNullStream
     164    Inherits NullStream
     165Public
     166    Sub WriteCountingNullStream()
     167        writeCount = 0
     168    End Sub
     169
     170    Override Sub Write(buffer As *Byte, offset As Long, count As Long)
     171        If count < 0 Then
     172            Throw New ArgumentOutOfRangeException("count")
     173        End If
     174        writeCount += count
     175    End Sub
     176
     177    Override Sub WriteByte(b As Byte)
     178        writeCount++
     179    End Sub
     180
     181    /*!
     182    @brief 書き込まれたバイト数を返す。
     183    */
     184    Function WriteCount() As Long
     185        WriteCount = writeCount
     186    End Function
     187
     188Private
     189    writeCount As Long
     190End Class
     191
    157192End Namespace
    158193
Note: See TracChangeset for help on using the changeset viewer.