## org.firebirdsql.gds.impl.wire
Class XdrOutputStream

    java.lang.Object
      org.firebirdsql.gds.impl.wire.XdrOutputStream

    public class XdrOutputStream

extends Object

An `XdrOutputStream` writes data in XDR format to an underlying `java.io.OutputStream`.

Version:
  1.0
Author:
  Alejandro Alberola, David Jencks

Constructor Summary
`protected` `XdrOutputStream()`
`` `XdrOutputStream(OutputStream out)` Create a new instance of `XdrOutputStream`.

Method Summary
`void` `close()` Close this stream and the underlying output stream.
`void` `flush()` Flush all buffered data to the underlying output stream.
`void` `write(byte[] b)` Write an array of `byte`s to the underlying output stream in XDR format.
`void` `write(byte[] b, int len, int pad)` Write a `byte` buffer to the underlying output stream in XDR format
`void` `write(int b)` Write a single `byte` to the underlying output stream in XDR format.
`void` `writeBlobBuffer(byte[] buffer)` Write a blob buffer to the underlying output stream in XDR format.
`void` `writeBuffer(byte[] buffer)` Write a `byte` buffer to the underlying output stream in XDR format.
`void` `writeInt(int v)` Write an `int` value to the underlying stream in XDR format.
`void` `writeLong(long v)` Write a `long` value to the underlying stream in XDR format.
`void` `writeSet(int type, byte[] s)` Write a set of distinct byte values (ie parameter buffer).
`void` `writeSQLData(XSQLDA xsqlda)` Write a set of SQL data from a `XSQLDA` data structure.
`void` `writeString(String s)` Write a `String` to the underlying output stream in XDR format.
`void` `writeString(String s, String encoding)` Write content of the specified string using the specified Java encoding.
`void` `writeTyped(int type, Xdrable item)` Write an `Xdrable` to this output stream.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XdrOutputStream

    protected XdrOutputStream()

### XdrOutputStream

    public XdrOutputStream(OutputStream out)

  Create a new instance of `XdrOutputStream`.

  Parameters:
    `out` - The underlying `OutputStream` to write to

Method Detail

### writeBuffer

    public void writeBuffer(byte[] buffer)
                     throws IOException

  Write a `byte` buffer to the underlying output stream in XDR format.

  Parameters:
    `buffer` - The `byte` buffer to be written
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### writeBlobBuffer

    public void writeBlobBuffer(byte[] buffer)
                         throws IOException

  Write a blob buffer to the underlying output stream in XDR format.

  Parameters:
    `buffer` - A `byte` array containing the blob
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### writeString

    public void writeString(String s)
                     throws IOException

  Write a `String` to the underlying output stream in XDR format.

  Parameters:
    `s` - The `String` to be written
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### writeString

    public void writeString(String s,
                            String encoding)
                     throws IOException

  Write content of the specified string using the specified Java encoding.

  Throws:
    `IOException`

### writeSet

    public void writeSet(int type,
                         byte[] s)
                  throws IOException

  Write a set of distinct byte values (ie parameter buffer).

  Parameters:
    `type` - The type of the parameter value being written, e.g. `ISCConstants.isc_tpb_version3`
    `s` - The set of byte values to be written
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### writeTyped

    public void writeTyped(int type,
                           Xdrable item)
                    throws IOException

  Write an `Xdrable` to this output stream.

  Parameters:
    `type` - Type of the `Xdrable` to be written, e.g. `ISCConstants.isc_tpb_version3`
    `item` - The object to be written
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### writeSQLData

    public void writeSQLData(XSQLDA xsqlda)
                      throws IOException

  Write a set of SQL data from a `XSQLDA` data structure.

  Parameters:
    `xsqlda` - The datastructure containing the SQL data to be written
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### writeLong

    public void writeLong(long v)
                   throws IOException

  Write a `long` value to the underlying stream in XDR format.

  Parameters:
    `v` - The `long` value to be written
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### writeInt

    public void writeInt(int v)
                  throws IOException

  Write an `int` value to the underlying stream in XDR format.

  Parameters:
    `v` - The `int` value to be written
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### write

    public void write(byte[] b,
                      int len,
                      int pad)
               throws IOException

  Write a `byte` buffer to the underlying output stream in XDR format

  Parameters:
    `b` - The `byte` buffer to be written
    `len` - The number of bytes to write
    `pad` - The number of (blank) padding bytes to write
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### write

    public void write(int b)
               throws IOException

  Write a single `byte` to the underlying output stream in XDR format.

  Parameters:
    `b` - The value to be written, will be truncated to a byte
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### write

    public void write(byte[] b)
               throws IOException

  Write an array of `byte`s to the underlying output stream in XDR format.

  Parameters:
    `b` - The `byte` array to be written
  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### flush

    public void flush()
               throws IOException

  Flush all buffered data to the underlying output stream.

  Throws:
    `IOException` - if an error occurs while writing to the underlying output stream

### close

    public void close()
               throws IOException

  Close this stream and the underlying output stream.

  Throws:
    `IOException` - if an error occurs while closing the underlying stream

Copyright © 2001-2010. All Rights Reserved.