ca.idms.io
Class UtfDataOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by ca.idms.io.NativeDataOutputStream
              extended by ca.idms.io.UtfDataOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataOutput, java.io.Flushable

public class UtfDataOutputStream
extends NativeDataOutputStream

A UtfDataOutputStream writes data in "network" format using UTF-8.

Since:
CA IDMS Server 4.2 OS/390 Edition
Version:
1.10, 0/03/00
Author:
Dave Ross

Field Summary
 
Fields inherited from class ca.idms.io.NativeDataOutputStream
dos, fmt
 
Fields inherited from class java.io.FilterOutputStream
out
 
Method Summary
 void writeBytes(java.lang.String str)
          Writes a string to a stream as an array of bytes.
 void writeBytes(java.lang.String str, int len)
          Writes a string to a stream as an array of bytes.
 
Methods inherited from class ca.idms.io.NativeDataOutputStream
getBuffer, getCount, getFormat, setBuffer, setCount, setSize, snap, toCharArray, write, writeBoolean, writeByte, writeBytesInternal, writeBytesVariable, writeChar, writeChars, writeDouble, writeFloat, writeGraphic, writeInt, writeLong, writeNulls, writePacked, writeShort, writeUTF, writeZoned
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write, write
 

Method Detail

writeBytes

public void writeBytes(java.lang.String str)
                throws java.io.IOException
Writes a string to a stream as an array of bytes.

Specified by:
writeBytes in interface java.io.DataOutput
Overrides:
writeBytes in class NativeDataOutputStream
Parameters:
str - String to convert
Throws:
java.io.IOException - if an IO error occurs

writeBytes

public void writeBytes(java.lang.String str,
                       int len)
                throws java.io.IOException
Writes a string to a stream as an array of bytes. Since the length is encoded in the UTF-8 data, and this class is used for the "platform independent" network format, no truncation or padding is done.

Overrides:
writeBytes in class NativeDataOutputStream
Parameters:
str - String to convert
len - the requested length is ignored
Throws:
java.io.IOException - if an IO error occurs
DataTruncationException - if the result is truncated
java.io.UnsupportedEncodingException - if the character set encoding is not supported
See Also:
NativeDataInputStream.readBytes(int)


Copyright © 2009 CA, All rights reserved