Saxon.Api

 

 

Saxon.Api

Class BinaryResource


public class BinaryResource
implements IResource

An implementation of IResource that represents plain text

Constructor Summary

BinaryResource (Byte[] content, Uri systemId)

Create a BinaryResource whose content is supplied as a constant string

 

Property Summary

 string ContentType

The content type of the resource: always application/binary

 Stream InputStream

Get a Stream for reading the content of this resource in binary.

 Uri ResourceUri

A URI that identifies this resource

 

Method Summary

 XdmItem GetXdmItem ()

Return the content of the resource as an item

 

Constructor Detail

BinaryResource

public BinaryResource(Byte[] content,
                      Uri systemId)

Create a BinaryResource whose content is supplied as a constant string

Parameters:

content - The plain text content
systemId - The base URI of the content

Property Detail

ContentType

public string ContentType {get; }

The content type of the resource: always application/binary

InputStream

public Stream InputStream {get; }

Get a Stream for reading the content of this resource in binary.

If an input stream is available, it is returned.

If a reader is available, or if the string content is available, then the content is read and a MemoryStream is returned delivering the content in UTF-8 encoding.

ResourceUri

public Uri ResourceUri {get; }

A URI that identifies this resource

Method Detail

GetXdmItem

public XdmItem GetXdmItem()

Return the content of the resource as an item

Returns:

An XdmAtomicValue of type xs:string holding the content of the resource