Package org.eclipse.net4j.util.io

## Class StringCompressor

- java.lang.Object
- - org.eclipse.net4j.util.io.StringCompressor

- All Implemented Interfaces:
    `StringIO`
  Direct Known Subclasses:
    `StringCompressor.Counting`

      public class StringCompressor
      extends java.lang.Object
      implements StringIO

  Since:
    2.0
  Author:
    Eike Stepper

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `StringCompressor.Counting` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static boolean` | `BYPASS` |

    - ### Fields inherited from interface org.eclipse.net4j.util.io.StringIO

      `DIRECT`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StringCompressor​(boolean client)` | Creates a StringCompressor instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.util.Collection<java.lang.Integer>` | `getPendingAcknowledgements​(long timeout)` |
    `boolean` | `isClient()` |
    `void` | `processAcknowledgements​(java.util.Collection<java.lang.Integer> acknowledgements)` |
    `java.lang.String` | `read​(ExtendedDataInput in)` |
    `java.util.Collection<java.lang.Integer>` | `readAcknowledgements​(ExtendedDataInput in)` |
    `protected java.lang.String` | `readString​(ExtendedDataInput in)` |
    `java.lang.String` | `toString()` |
    `void` | `write​(ExtendedDataOutput out, java.lang.String string)` |
    `void` | `writeAcknowledgements​(ExtendedDataOutput out, java.util.Collection<java.lang.Integer> acknowledgements)` |
    `protected void` | `writeString​(ExtendedDataOutput out, java.lang.String value)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### BYPASS

          public static boolean BYPASS

      Since:
        3.0

  - ### Constructor Detail

    - #### StringCompressor

          public StringCompressor​(boolean client)

      Creates a StringCompressor instance.
      Parameters:
        `client` - Must be different on both sides of the stream.

  - ### Method Detail

    - #### isClient

          public boolean isClient()

    - #### write

          public void write​(ExtendedDataOutput out,
                            java.lang.String string)
                     throws java.io.IOException

      Specified by:
        `write` in interface `StringIO`
      Throws:
        `java.io.IOException`

    - #### read

          public java.lang.String read​(ExtendedDataInput in)
                                throws java.io.IOException

      Specified by:
        `read` in interface `StringIO`
      Throws:
        `java.io.IOException`

    - #### getPendingAcknowledgements

          public java.util.Collection<java.lang.Integer> getPendingAcknowledgements​(long timeout)

      Since:
        3.8

    - #### writeAcknowledgements

          public void writeAcknowledgements​(ExtendedDataOutput out,
                                            java.util.Collection<java.lang.Integer> acknowledgements)
                                     throws java.io.IOException

      Throws:
        `java.io.IOException`
      Since:
        3.8

    - #### readAcknowledgements

          public java.util.Collection<java.lang.Integer> readAcknowledgements​(ExtendedDataInput in)
                                                                       throws java.io.IOException

      Throws:
        `java.io.IOException`
      Since:
        3.8

    - #### processAcknowledgements

          public void processAcknowledgements​(java.util.Collection<java.lang.Integer> acknowledgements)

      Since:
        3.8

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### writeString

          protected void writeString​(ExtendedDataOutput out,
                                     java.lang.String value)
                              throws java.io.IOException

      Throws:
        `java.io.IOException`
      Since:
        3.0

    - #### readString

          protected java.lang.String readString​(ExtendedDataInput in)
                                         throws java.io.IOException

      Throws:
        `java.io.IOException`
      Since:
        3.0