Oracle® Database PL/SQL Packages and Types Reference 11g Release 1 (11.1) Part Number B28419-01 |
|
|
View PDF |
UTL
Streams
Types
describes 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.
See Also:
For more information, see AWAITING INFORMATION.This chapter contains the following topics:
Table 239-1 UTL Binary Streams Types
Type | Description |
---|---|
UTL_BINARYINPUTSTREAM Type |
Reads bytes and closes a stream. |
UTL_BINARYOUTPUTSTREAM Type |
Writes bytes and closes a stream. |
UTL_CHARACTERINPUTSTREAM Type |
Reads chars and closes a stream. |
UTL_CHARACTEROUTPUTSTREAM Type |
Writes chars and closes a stream. |
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 239-2 UTL_BINARYINPUTSTREAM Type Member Subprograms
Member Subprogram | Description |
---|---|
AVAILABLE |
Returns the number of bytes available to be read |
READ |
|
CLOSE |
Releases all resources held on the node to support the stream |
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 239-3 UTL_BINARYOUTPUTSTREAM Type Member Subprograms
Member Subprogram | Description |
---|---|
WRITE |
|
FLUSH |
Insures that any buffered bytes are copied to the node destination |
CLOSE |
Frees all resources associated with the stream |
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 239-4 UTL_CHARACTERINPUTSTREAM Type Member Subprograms
Member Subprogram | Description |
---|---|
AVAILABLE |
Returns the number of bytes available to be read |
READ |
|
CLOSE |
Releases all resources held by the stream |
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 239-5 UTL_CHARACTEROUTPUTSTREAM Type Member Subprograms
Member Subprogram | Description |
---|---|
WRITE |
|
FLUSH |
Copies all characters that may be contained within buffers to the node value |
CLOSE |
Releases all resources held by the stream |