Interface ByteCoder


  • public interface ByteCoder
    An utility interface for converting Objects to bytes for storage or network transport. For some common, general-purpose ByteCoders, see the GlazedLists factory class.
    Author:
    Jesse Wilson
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object decode​(java.io.InputStream source)
      Decode the Object from the specified InputStream.
      void encode​(java.lang.Object source, java.io.OutputStream target)
      Encode the specified Object over the specified OutputStream.
    • Method Detail

      • encode

        void encode​(java.lang.Object source,
                    java.io.OutputStream target)
             throws java.io.IOException
        Encode the specified Object over the specified OutputStream.
        Throws:
        java.io.IOException
      • decode

        java.lang.Object decode​(java.io.InputStream source)
                         throws java.io.IOException
        Decode the Object from the specified InputStream. The stream should contain exactly one Object and no further bytes before the end of the stream.
        Throws:
        java.io.IOException