283 UTL Streams Types
UTL Streams Types describe abstract types used with Oracle XML functionality.
Four abstract PL/SQL streams are introduced and defined within the 'SYS' schema. The streams may be referenced by PUBLIC and are described in the following sections.
This chapter contains the following topics:
See Also:
For more information, see Oracle XML DB Developer's Guide
283.2 Summary of UTL Binary Streams Types
This table lists the UTL Binary Streams Types and briefly describes them.
Table 283-1 UTL Streams Types
| Type | Description |
|---|---|
|
Reads bytes and closes a stream. |
|
|
Writes bytes and closes a stream. |
|
|
Reads chars and closes a stream. |
|
|
Writes chars and closes a stream. |
283.2.1 UTL_BINARYINPUTSTREAM Type
This type is similar to java.io.InputStream in that it can only read and close a stream.
Syntax
CREATE OR REPLACE TYPE Utl_BinaryInputStream AS OBJECT (
MEMBER FUNCTION available (
self IN OUT NOCOPY Utl_BinaryInputStream)
RETURN INTEGER,
MEMBER FUNCTION read ( -- #1
self IN OUT NOCOPY Utl_BinaryInputStream,
numBytes IN INTEGER DEFAULT 1)
RETURN RAW,
MEMBER PROCEDURE read ( -- #2
self IN OUT NOCOPY Utl_BinaryInputStream,
bytes IN OUT NOCOPY RAW,
numBytes IN OUT INTEGER),
MEMBER PROCEDURE read ( -- #3
self IN OUT NOCOPY Utl_BinaryInputStream,
bytes IN OUT NOCOPY RAW,
offset IN INTEGER,
numBytes IN OUT INTEGER),
member function close (
self In Out Nocopy Utl_BinaryInputStream)
) NOT FINAL;Attributes
Table 283-2 UTL_BINARYINPUTSTREAM Type Member Subprograms
| Member Subprogram | Description |
|---|---|
|
|
Returns the number of bytes available to be read |
|
|
|
|
|
Releases all resources held on the node to support the stream |
283.2.2 UTL_BINARYOUTPUTSTREAM Type
This type is similar to java.io.OutputStream in that it can only write and close a stream.
Syntax
CREATE OR REPLACE TYPE Utl_BinaryOutputStream AS OBJECT (
MEMBER FUNCTION write ( -- #1
self IN OUT NOCOPY sys.utl_BinaryOutputStream,
bytes IN RAW,
numBytes IN INTEGER DEFAULT 1)
RETURN INTEGER,
MEMBER PROCEDURE write ( -- #2
self IN OUT NOCOPY sys.utl_BinaryOutputStream,
bytes IN NOCOPY RAW,
numBytes IN OUT INTEGER),
MEMBER PROCEDURE write ( -- #3
self IN OUT NOCOPY utl_BinaryOutputStream, bytes IN NOCOPY RAW,
offset IN INTEGER,
numBytes IN OUT INTEGER),
MEMBER PROCEDURE flush (
self IN OUT NOCOPY utl_BinaryOutputStream),
MEMBER PROCEDURE close (
self IN OUT NOCOPY utl_BinaryOutputStream)
) NOT FINAL;Attributes
Table 283-3 UTL_BINARYOUTPUTSTREAM Type Member Subprograms
| Member Subprogram | Description |
|---|---|
|
|
|
|
|
Insures that any buffered bytes are copied to the node destination |
|
|
Frees all resources associated with the stream |
283.2.3 UTL_CHARACTERINPUTSTREAM Type
This type is similar to java.io.Reader in that it can only read characters (chars) and close a stream.
Syntax
CREATE OR REPLACE TYPE Utl_CharacterInputStream AS OBJECT (
MEMBER FUNCTION available (
self IN OUT NOCOPY utl_CharacterInputStream)
RETURN INTEGER,
MEMBER FUNCTION read ( -- #1
self IN OUT NOCOPY utl_CharacterInputStream,
numChars IN INTEGER DEFAULT 1,
lineFeed IN BOOLEAN DEFAULT FALSE)
RETURN VARCHAR2,
MEMBER PROCEDURE read ( -- #2
self IN OUT NOCOPY utl_CharacterInputStream,
chars IN OUT NOCOPY VARCHAR2,
numChars IN OUT INTEGER,
lineFeed IN BOOLEAN DEFAULT FALSE),
MEMBER PROCEDURE read ( -- #3
self IN OUT NOCOPY utl_CharacterInputStream,
chars IN OUT NOCOPY VARCHAR2,
offset IN INTEGER,
numChars IN OUT INTEGER,
lineFeed IN BOOLEAN DEFAULT FALSE),
MEMBER PROCEDURE close (
self IN OUT NOCOPY utl_CharacterInputStream)
) NOT FINAL;Attributes
Table 283-4 UTL_CHARACTERINPUTSTREAM Type Member Subprograms
| Member Subprogram | Description |
|---|---|
|
|
Returns the number of bytes available to be read |
|
|
|
|
|
Releases all resources held by the stream |
283.2.4 UTL_CHARACTEROUTPUTSTREAM Type
This type is similar to java.io.Reader in that it can only read characters (chars) and close a stream.
Syntax
CREATE OR REPLACE TYPE utl_CharacterOutputStream AS OBJECT (
MEMBER FUNCTION write ( -- #1
self IN OUT NOCOPY utl_CharacterOutputStream,
chars IN VARCHAR2,
numChars IN INTEGER DEFAULT 1,
lineFeed IN BOOLEAN DEFAULT FALSE)
RETURN INTEGER,
MEMBER PROCEDURE write ( -- #2
self IN OUT NOCOPY utl_CharacterOutputStream,
chars IN OUT NOCOPY VARCHAR2,
numChars IN OUT INTEGER,
lineFeed IN BOOLEAN DEFAULT FALSE),
member procedure write ( -- #3
self IN OUT NOCOPY utl_CharacterOutputStream,
chars IN NOCOPY varchar2,
offset IN integer,
numChars IN OUT integer,
lineFeed IN boolean default false),
MEMBER PROCEDURE flush (
self IN OUT NOCOPY utl_CharacterOutputStream),
MEMBER PROCEDURE close (
self IN OUT NOCOPY utl_CharacterOutputStream)
) NOT FINAL;Attributes
Table 283-5 UTL_CHARACTEROUTPUTSTREAM Type Member Subprograms
| Member Subprogram | Description |
|---|---|
|
|
|
|
|
Copies all characters that may be contained within buffers to the node value |
|
|
Releases all resources held by the stream |