Documentation of 'ec.util.DataPipe' Java class
DataPipe
ec.util

Class DataPipe



  • public class DataPipe
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      java.io.DataInputStream input
      The input stream
      java.io.DataOutputStream output
      The output stream
    • Constructor Summary

      Constructors 
      Constructor and Description
      DataPipe() 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.Object copy(java.io.Serializable obj)
      A poor-man's clone for serializable but not cloneable objects: serializes an object to the pipe, then deserializes it.
      int numRead()
      Returns the number of elements read from the buffer so far (after the last reset()).
      int numWritten()
      Returns the number of elements written to the buffer so far (after the last reset()).
      void reset()
      Reset the buffer.
      int size()
      Returns the total size of the buffer.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

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

      • input

        public java.io.DataInputStream input
        The input stream
      • output

        public java.io.DataOutputStream output
        The output stream
    • Constructor Detail

      • DataPipe

        public DataPipe()
    • Method Detail

      • reset

        public void reset()
        Reset the buffer. Does not resize it back to a smaller size -- if it has ballooned it will stay large, though it will no longer have wasted space in it. If you wish to make the buffer a more manageable size, create a new DataPipe instead.
      • size

        public int size()
        Returns the total size of the buffer.
      • numWritten

        public int numWritten()
        Returns the number of elements written to the buffer so far (after the last reset()).
      • numRead

        public int numRead()
        Returns the number of elements read from the buffer so far (after the last reset()).
      • copy

        public static java.lang.Object copy(java.io.Serializable obj)
                                     throws java.io.IOException,
                                            java.lang.ClassNotFoundException
        A poor-man's clone for serializable but not cloneable objects: serializes an object to the pipe, then deserializes it.
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • toString

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

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.