Class org.as2lib.io.file.ByteFormat

org.as2lib.core.BasicClass
   +--org.as2lib.io.file.BitFormat
      +--org.as2lib.io.file.ByteFormat

Description

Formater for bytes. This class gets used for formatting bits in Kilo/Mega/Giga/Tera bytes.

Method Index

new ByteFormat()

toString()

Inherited from BitFormat

getBit(), getBytes(), getGigaBit(), getGigaBytes(), getKiloBit(), getKiloBytes(), getMegaBit(), getMegaBytes(), getTeraBit(), getTeraBytes(), setFloatingPoints()

Constructor Detail

ByteFormat

public function ByteFormat(bytes:Number)

Creates a new ByteFormat

Parameters

bytesBytes to be formatted.

Method Detail

toString

public function toString():String

Extended toString method for a well formatted bytevalue. This method uses the next matching size and adds the matching Shortname for it. Examples: new ByteFormat(1).toString(); // 1B new ByteFormat(1234).toString(); // 1.21KB new ByteFormat(15002344).toString(); // 14.31MB

Return

bytes as string with correct ending.

Specified By

toString() in org.as2lib.core.BasicInterface

Overrides

toString() in org.as2lib.io.file.BitFormat