ca.idms.io
Class UnicodeDataOutputStream

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

public class UnicodeDataOutputStream
extends NativeDataOutputStream

A UnicodeDataOutputStream writes data in "network" format using Unicode.

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 fixed length 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,
                       java.io.UnsupportedEncodingException,
                       DataTruncationException
Writes a string to a stream as fixed length an array of bytes. The String is converted according to the encoding specified by the NativeFormat object and written to the output stream, padded with spaces if needed. Since each character is written as two bytes, the effective length is twice the supplied length.

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


Copyright © 2009 CA, All rights reserved