Class DNSOutgoing.MessageOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable
    Enclosing class:
    DNSOutgoing

    public static class DNSOutgoing.MessageOutputStream
    extends java.io.ByteArrayOutputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int _offset  
      private DNSOutgoing _out  
      • Fields inherited from class java.io.ByteArrayOutputStream

        buf, count
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static int indexOfSeparator​(java.lang.String aName)  
      (package private) void writeByte​(int value)  
      void writeBytes​(byte[] data)  
      (package private) void writeBytes​(byte[] data, int off, int len)  
      (package private) void writeBytes​(java.lang.String str, int off, int len)  
      (package private) void writeInt​(int value)  
      (package private) void writeName​(java.lang.String name)  
      (package private) void writeName​(java.lang.String name, boolean useCompression)  
      (package private) void writeQuestion​(DNSQuestion question)  
      (package private) void writeRecord​(DNSRecord rec, long now)  
      (package private) void writeShort​(int value)  
      (package private) void writeUTF​(java.lang.String str, int off, int len)  
      • Methods inherited from class java.io.ByteArrayOutputStream

        close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo
      • Methods inherited from class java.io.OutputStream

        flush, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _offset

        private final int _offset
    • Constructor Detail

      • MessageOutputStream

        MessageOutputStream​(int size,
                            DNSOutgoing out)
        Creates a new message stream, with a buffer capacity of the specified size, in bytes.
        Parameters:
        size - the initial size.
        Throws:
        java.lang.IllegalArgumentException - if size is negative.
      • MessageOutputStream

        MessageOutputStream​(int size,
                            DNSOutgoing out,
                            int offset)
    • Method Detail

      • writeByte

        void writeByte​(int value)
      • writeBytes

        void writeBytes​(java.lang.String str,
                        int off,
                        int len)
      • writeBytes

        public void writeBytes​(byte[] data)
      • writeBytes

        void writeBytes​(byte[] data,
                        int off,
                        int len)
      • writeShort

        void writeShort​(int value)
      • writeInt

        void writeInt​(int value)
      • writeUTF

        void writeUTF​(java.lang.String str,
                      int off,
                      int len)
      • writeName

        void writeName​(java.lang.String name)
      • writeName

        void writeName​(java.lang.String name,
                       boolean useCompression)
      • indexOfSeparator

        private static int indexOfSeparator​(java.lang.String aName)
      • writeQuestion

        void writeQuestion​(DNSQuestion question)
      • writeRecord

        void writeRecord​(DNSRecord rec,
                         long now)