Class BlobBuffer.BlobOutputStream

java.lang.Object
java.io.OutputStream
net.sourceforge.jtds.util.BlobBuffer.BlobOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
Enclosing class:
BlobBuffer

private class BlobBuffer.BlobOutputStream extends OutputStream
Implements an OutputStream for BLOB data.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
     
    private int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlobOutputStream(long pos)
    Costructs an OutputStream object over the BLOB buffer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the output stream.
    protected void
    Ensures underlying BLOB file can be closed even if user does not close this stream.
    void
    write(byte[] bytes, int offset, int len)
    Write bytes to the BLOB buffer.
    void
    write(int b)
    Write a byte to the BLOB buffer.

    Methods inherited from class java.io.OutputStream

    flush, nullOutputStream, write

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • writePtr

      private int writePtr
    • open

      private boolean open
  • Constructor Details

    • BlobOutputStream

      BlobOutputStream(long pos) throws IOException
      Costructs an OutputStream object over the BLOB buffer.
      Parameters:
      pos - the starting position (from 0)
      Throws:
      IOException - if an I/O error occurs
  • Method Details

    • finalize

      protected void finalize() throws Throwable
      Ensures underlying BLOB file can be closed even if user does not close this stream.
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • write

      public void write(int b) throws IOException
      Write a byte to the BLOB buffer.
      Specified by:
      write in class OutputStream
      Parameters:
      b - the byte value to write
      Throws:
      IOException - if an I/O error occurs
    • write

      public void write(byte[] bytes, int offset, int len) throws IOException
      Write bytes to the BLOB buffer.
      Overrides:
      write in class OutputStream
      Parameters:
      bytes - the byte array value to write
      offset - the start position in the byte array
      len - the number of bytes to write
      Throws:
      IOException - if an I/O error occurs
    • close

      public void close() throws IOException
      Close the output stream.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream
      Throws:
      IOException - if an I/O error occurs