001 package com.skype.ipc;
002
003 import java.io.IOException;
004
005 public interface Transport
006 {
007 /**
008 * brief Connects to skypekit. When this function returns successfully, you
009 * can start sending and receiving messages.
010 */
011 public boolean connect() throws IOException;
012
013 /**
014 * Disconnects from skypekit
015 **/
016 public void disconnect() throws IOException;
017
018 public boolean hasMore() throws IOException;
019
020 /** \brief Read one byte. */
021 public int read() throws IOException;
022
023 /** \brief Check value of next byte, but do not remove from stream. */
024 public int peek() throws IOException;
025
026 /** \brief Read as many bytes as possible, but not more than num_bytes. */
027 public int read(int num_bytes, byte[] bytes) throws IOException;
028
029 /**
030 * \brief Read number of bytes indicated. Block until all bytes collected.
031 * \returns number bytes read
032 */
033 public int read(int num_bytes, byte[] bytes, boolean require_num_bytes) throws IOException;
034
035 /** \brief Write one byte. */
036 public boolean write(byte b) throws IOException;
037
038 /** \brief Write buffer to stream. */
039 public boolean write(int num_bytes, byte[] bytes) throws IOException;
040
041 /** \brief Check if the connection to SkypeKit is still there. */
042 public boolean isConnected() throws IOException;
043
044 /** \brief start transport logging to two files based on logFileName path. */
045 public void startLogging(String logFileName);
046 }