@Override
  public ByteSource slice(int startOffset, int endOffset) {
    try {
      return super.slice(startOffset, endOffset);
    } catch (IllegalArgumentException e) {
      throw new PdxSerializationException(
          "Internal error; failed to slice start=" + startOffset + " end=" + endOffset, e);
    }
  }
Create a pdx input stream by copying another. A somewhat shallow copy is made.

@param copy the input stream to copy. Note that this copy stream will be read by this class (a
       copy is not made) so it should not be changed externally.
geode-core/src/main/java/org/apache/geode/pdx/internal/PdxInputStream.java