Interface ByteArrayDataOutput

  • All Superinterfaces:
    DataOutput


    public interface ByteArrayDataOutput
    extends DataOutput
    An extension of DataOutput for writing to in-memory byte arrays; its methods offer identical functionality but do not throw IOException.
    Since:
    1.0
    • Method Summary

      Modifier and Type Method and Description
      byte[] toByteArray()
      Returns the contents that have been written to this instance, as a byte array.
      void write(byte[] b)
       
      void write(byte[] b, int off, int len)
       
      void write(int b)
       
      void writeBoolean(boolean v)
       
      void writeByte(int v)
       
      void writeBytes(String s)
      Deprecated. 
      This method is dangerous as it discards the high byte of every character. For UTF-8, use write(s.getBytes(Charsets.UTF_8)).
      void writeChar(int v)
       
      void writeChars(String s)
       
      void writeDouble(double v)
       
      void writeFloat(float v)
       
      void writeInt(int v)
       
      void writeLong(long v)
       
      void writeShort(int v)
       
      void writeUTF(String s)
       
    • Method Detail

      • write

        void write(int b)
      • write

        void write(byte[] b)
      • write

        void write(byte[] b,
                   int off,
                   int len)
      • writeBoolean

        void writeBoolean(boolean v)
      • writeByte

        void writeByte(int v)
      • writeShort

        void writeShort(int v)
      • writeChar

        void writeChar(int v)
      • writeInt

        void writeInt(int v)
      • writeLong

        void writeLong(long v)
      • writeFloat

        void writeFloat(float v)
      • writeDouble

        void writeDouble(double v)
      • writeChars

        void writeChars(String s)
      • writeUTF

        void writeUTF(String s)
      • writeBytes

        @Deprecated
        void writeBytes(String s)
        Deprecated.  This method is dangerous as it discards the high byte of every character. For UTF-8, use write(s.getBytes(Charsets.UTF_8)).
      • toByteArray

        byte[] toByteArray()
        Returns the contents that have been written to this instance, as a byte array.