Class VSocketOutputStream

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

    public class VSocketOutputStream
    extends java.io.OutputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int CAPACITY  
      static int INCREMENT  
    • Constructor Summary

      Constructors 
      Constructor Description
      VSocketOutputStream​(java.io.OutputStream out, java.lang.String socketIdStr)  
    • Field Detail

      • CAPACITY

        public static int CAPACITY
      • INCREMENT

        public static int INCREMENT
    • Constructor Detail

      • VSocketOutputStream

        public VSocketOutputStream​(java.io.OutputStream out,
                                   java.lang.String socketIdStr)
    • Method Detail

      • write

        public void write​(byte[] b)
        Overrides:
        write in class java.io.OutputStream
      • write

        public void write​(int b)
        Specified by:
        write in class java.io.OutputStream
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
        Overrides:
        write in class java.io.OutputStream
      • writeTwoArrays

        public void writeTwoArrays​(byte[] b1,
                                   int off1,
                                   int len1,
                                   byte[] b2,
                                   int off2,
                                   int len2)
        Same as calling write(byte[], int, int) two times but a little bit more effective.
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException
      • getBytesWritten

        public long getBytesWritten()
      • confirm

        public void confirm​(long size)
      • writeTo

        public void writeTo​(VSocketOutputStream out)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • isBroken

        public boolean isBroken()
      • toString

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