Class org.as2lib.data.type.Byte

Description

Byte is represents a byte value.

Byte can be used for a different kind of formatting of a byte value. It allows to access the value as bit, kilo-bit, mega-bit, giga-bit, tera-bit, byte, kilo-byte, mega-byte, giga-byte and tera-byte.

Field Index

Inherited from Bit

Method Index

new Byte()
toString()

Inherited from Bit

Constructor Detail

Byte

public function Byte(bytes:Number)

Constructs a new Byte.

Parameters

bytesvalue in byte

Method Detail

toString

public function toString():String

Extended toString method for a well formatted byte value.

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.data.type.Bit

See Also

  • BitFormat#DEFAULT_FLOATING_POINTS