|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ide.util.TextBufferStreamFactory
public final class TextBufferStreamFactory
The TextBufferStreamFactory
is a utilities class for creating InputStream
and OutputStream
wrappers for a TextBuffer
. This is used primarily to support the getInputStream()
and getOutputStream
of the IDE Document interface implemented by IDE nodes in order to support legacy Addins (such as old JOT.)
Note that the use of getInputStream()
and getOutputStream
of a node is highly discouraged as it is quite a severe performance hit. Both of these operations in this class are very expensive. It takes at least 3 copy operations of the entire buffer to support getInputStream() (not including reading the data from the Inputstream.) It takes at least 4 copy operations of the entire buffer to support getOutputStream() (not including writing the data to the OutputStream.) This should be sufficient incentive to deprecate these two calls.
Constructor Summary | |
---|---|
TextBufferStreamFactory() |
Method Summary | |
---|---|
static java.io.InputStream |
getInputStream(TextBuffer textBuffer) Create an InputStream object used for reading the data from a text buffer as an InputStream. |
static java.io.InputStream |
getInputStream(TextBuffer textBuffer, java.lang.String encoding) Create an InputStream object used for reading the data from a text buffer as an InputStream. |
static java.io.OutputStream |
getOutputStream(TextBuffer textBuffer) Deprecated. Use oracle.javatools.buffer.TextBufferFactory.createReader instead. |
static java.io.OutputStream |
getOutputStream(TextBuffer textBuffer, java.lang.String encoding) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextBufferStreamFactory()
Method Detail |
---|
public static java.io.InputStream getInputStream(TextBuffer textBuffer)
InputStream
object used for reading the data from a text buffer as an InputStream. Note that the contents of the buffer are copied out when this call is made, so subsequent changes to the buffer will not be available through the created InputStream
.textBuffer
- the text buffer to wrappublic static java.io.InputStream getInputStream(TextBuffer textBuffer, java.lang.String encoding)
InputStream
object used for reading the data from a text buffer as an InputStream. Note that the contents of the buffer are copied out when this call is made, so subsequent changes to the buffer will not be available through the created InputStream
.textBuffer
- the text buffer to wrapencoding
- the encoding to use when converting chars to bytes; null encoding means to use the platform default encoding.public static java.io.OutputStream getOutputStream(TextBuffer textBuffer)
OutputStream
object used for writing the data to an text buffer using an OutputStream
interface. Note that the buffer is locked with exclusive access for as long as the OutputStream
remains open. You must close the OutputStream
in order for the buffer lock to be released.textBuffer
- the text buffer to wrappublic static java.io.OutputStream getOutputStream(TextBuffer textBuffer, java.lang.String encoding)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |