Classic ASP Framework
org.classicasp.primitive.BinaryEx

To create a BinaryEx object, you can use the constructor or the global function, or assign a literal value.

Example 1

	
  Response.Write BinaryEx("C:\example.jpg").toBase64String().toJSON()
  

Example 1 Output

"VGhpcyBpcyBhIGpwZyBmaWxlLg=="

Summary

Gets the number of bytes of data available for reading from the current position of the array.
Clears the contents of the array and resets the length and position properties to 0.
Gets the length of the array.
Gets the specified number of bytes and returns the resulting data, as a string byte array.
Gets the specified number of bytes and returns the resulting data, as a byte array.
Returns a Base64 encoded string representation of the object.
Returns a Bencoded string representation of the object.
Returns a json encoded string representation of the object.
Returns a string representation of the object.
Returns an XML encoded string representation of the object.
Writes the data to the array.
Writes the binary data to the client.
Writes the binary data to a file.
Writes a json encoded string representation of the object.
Writes a multibyte string to the byte stream using the specified character set.
Writes an XML encoded string representation of the object.

bytesAvailable

Public Function bytesAvailable()
Gets the number of bytes of data available for reading from the current position of the array.

Returns

NumberEx

clear

Public Sub clear()
Clears the contents of the array and resets the length and position properties to 0.

Returns

N/A

length

Public Function length()
Gets the length of the array.

Returns

NumberEx

read

Public Function read(ByVal vInputValue)
Gets the specified number of bytes and returns the resulting data, as a string byte array. [Use -1 to read all]

Returns

Byte [Byte String - LenB, InStrB, MidB]

readByteArray

Public Function readByteArray(ByVal vInputValue)
Gets the specified number of bytes and returns the resulting data, as a byte array. [Use -1 to read all]

Returns

Array

toBase64String

Public Function toBase64String()
Returns a Base64 encoded string representation of the object.

Returns

StringEx

toBencode

Public Function toBencode()
Returns a Bencoded string representation of the object.

Returns

String

Example

		
	  Response.Write BinaryEx("").toBencode()
	  

Output

0:

toJSON

Public Function toJSON()
Returns a json encoded string representation of the object.

Returns

String

Example

		
	  Response.Write BinaryEx("").toJSON()
	  

Output

""

toString

Public Function toString()
Returns a string representation of the object.

Returns

StringEx

toXML

Public Function toXML()
Returns an XML encoded string representation of the object.

Returns

String

Example

		
	  Response.Write BinaryEx("").toXML()
	  

Output

<data type="Binary"></data>

write

Public Sub write(ByRef vInputValue)
Writes the data to the array.

Returns

N/A

writeBinary

Public Sub writeBinary()
Writes the binary data to the client.

Returns

N/A

writeFile

Public Sub writeFile(ByVal vInputValueFilename)
Writes the binary data to a file.

Returns

N/A

writeJSON

Public Sub writeJSON()
Writes a json encoded string representation of the object.

Returns

N/A

Example

		
	  Call BinaryEx("").writeJSON()
	  

Output

""

writeMultiByte

Public Sub writeMultiByte(
ByRef vInputValue,
ByRef sCharset)
Writes a multibyte string to the byte stream using the specified character set.

Returns

N/A

writeXML

Public Sub writeXML()
Writes an XML encoded string representation of the object.

Returns

N/A

Example

		
	  Call BinaryEx("").writeXML()
	  

Output

<data type="Binary"></data>

'***ClassicASP.org
'Copyright 2010 ClassicASP.org

'This file is part of ClassicASP Framework.

'ClassicASP-Framework is free software: you can redistribute it and/or modify
'it under the terms of the GNU General Public License as published by
'the Free Software Foundation, version 3 of the License.

'ClassicASP-Framework is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'GNU General Public License for more details.

'You should have received a copy of the GNU General Public License
'along with ClassicASP-Framework. If not, see .

'For additional information please visit .