Class BaseDataOutputStream

  • All Implemented Interfaces:
    java.io.DataOutput
    Direct Known Subclasses:
    ByteArrayDataOutputStream, PartialOutputStream

    public abstract class BaseDataOutputStream
    extends java.lang.Object
    implements java.io.DataOutput
    Implements DataOutput in a generic manner, so that subclasses can implement specific behavior. Some write() methods are abstract and need to be implemennted in subclasses. Filed pos points to the current write-position.
    Since:
    5.0
    Author:
    Bela Ban
    • Field Detail

      • pos

        protected int pos
    • Constructor Detail

      • BaseDataOutputStream

        public BaseDataOutputStream()
    • Method Detail

      • position

        public int position()
      • write

        public abstract void write​(int b)
        Specified by:
        write in interface java.io.DataOutput
      • write

        public void write​(byte[] b)
        Specified by:
        write in interface java.io.DataOutput
      • write

        public abstract void write​(byte[] b,
                                   int off,
                                   int len)
        Specified by:
        write in interface java.io.DataOutput
      • writeBoolean

        public void writeBoolean​(boolean v)
        Specified by:
        writeBoolean in interface java.io.DataOutput
      • writeByte

        public void writeByte​(int v)
        Specified by:
        writeByte in interface java.io.DataOutput
      • writeShort

        public void writeShort​(int v)
        Specified by:
        writeShort in interface java.io.DataOutput
      • writeChar

        public void writeChar​(int v)
        Specified by:
        writeChar in interface java.io.DataOutput
      • writeInt

        public void writeInt​(int v)
        Specified by:
        writeInt in interface java.io.DataOutput
      • writeLong

        public void writeLong​(long v)
        Specified by:
        writeLong in interface java.io.DataOutput
      • writeFloat

        public void writeFloat​(float v)
        Specified by:
        writeFloat in interface java.io.DataOutput
      • writeDouble

        public void writeDouble​(double v)
        Specified by:
        writeDouble in interface java.io.DataOutput
      • writeBytes

        public void writeBytes​(java.lang.String s)
        Specified by:
        writeBytes in interface java.io.DataOutput
      • writeChars

        public void writeChars​(java.lang.String s)
        Specified by:
        writeChars in interface java.io.DataOutput
      • writeUTF

        public void writeUTF​(java.lang.String str)
        Specified by:
        writeUTF in interface java.io.DataOutput
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • checkBounds

        protected int checkBounds​(int pos)
      • ensureCapacity

        protected abstract void ensureCapacity​(int bytes)
        Makes sure that bytes can be written to the output stream (e.g. a byte array has enough space left)