Documentation of 'org.hsqldb.lib.InOutUtil' Java class
InOutUtil
org.hsqldb.lib

Class InOutUtil



  • public final class InOutUtil
    extends java.lang.Object
    Input / Output utility
    Since:
    1.7.2
    • Constructor Summary

      Constructors 
      Constructor and Description
      InOutUtil() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static long copy(java.io.InputStream inputStream, java.io.OutputStream outputStream) 
      static long copy(java.io.InputStream inputStream, java.io.OutputStream outputStream, long amount) 
      static long copy(java.io.InputStream inputStream, java.io.OutputStream outputStream, long amount, int bufferSize)
      the specified amount from the given input stream to the given output stream, using a buffer of the given size.
      static long copy(java.io.Reader reader, java.io.Writer writer) 
      static long copy(java.io.Reader reader, java.io.Writer writer, long amount) 
      static long copy(java.io.Reader reader, java.io.Writer writer, long amount, int bufferSize)
      the specified amount from the given input stream to the given output stream, using a buffer of the given size.
      static java.io.Serializable deserialize(byte[] ba)
      Deserializes the specified byte array to an Object instance.
      static int readLine(java.io.InputStream in, java.io.OutputStream out)
      Implementation only supports unix line-end format and is suitable for processing HTTP and other network protocol communications.
      static byte[] serialize(java.io.Serializable s)
      Retrieves the serialized form of the specified Object as an array of bytes.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InOutUtil

        public InOutUtil()
    • Method Detail

      • readLine

        public static int readLine(java.io.InputStream in,
                                   java.io.OutputStream out)
                            throws java.io.IOException
        Implementation only supports unix line-end format and is suitable for processing HTTP and other network protocol communications. Reads and writes a line of data. Returns the number of bytes read/written.
        Throws:
        java.io.IOException
      • serialize

        public static byte[] serialize(java.io.Serializable s)
                                throws java.io.IOException
        Retrieves the serialized form of the specified Object as an array of bytes.
        Parameters:
        s - the Object to serialize
        Returns:
        a static byte array representing the passed Object
        Throws:
        java.io.IOException
      • deserialize

        public static java.io.Serializable deserialize(byte[] ba)
                                                throws java.io.IOException,
                                                       java.lang.ClassNotFoundException
        Deserializes the specified byte array to an Object instance.
        Parameters:
        ba - the byte array to deserialize to an Object
        Returns:
        the Object resulting from deserializing the specified array of bytes
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • copy

        public static long copy(java.io.InputStream inputStream,
                                java.io.OutputStream outputStream,
                                long amount,
                                int bufferSize)
                         throws java.io.IOException
        the specified amount from the given input stream to the given output stream, using a buffer of the given size.
        Parameters:
        inputStream - from which to source bytes
        outputStream - to which to sink bytes
        amount - max # of bytes to transfer.
        bufferSize - to use internally
        Returns:
        the number of bytes actually transfered.
        Throws:
        java.io.IOException - if any, thrown by either of the given stream objects
      • copy

        public static long copy(java.io.Reader reader,
                                java.io.Writer writer,
                                long amount,
                                int bufferSize)
                         throws java.io.IOException
        the specified amount from the given input stream to the given output stream, using a buffer of the given size.
        Parameters:
        inputStream - from which to source characters
        outputStream - to which to sink characters
        amount - max # of characters to transfer.
        bufferSize - to use internally
        Returns:
        the number of characters actually transfered.
        Throws:
        java.io.IOException - if any, thrown by either of the given stream objects

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.