Overview | Package | Class | Tree | Deprecated | Index | Help
| Bouncy Castle Cryptography Library 1.85
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.bouncycastle.crypto
Interface SkippingCipher

All Known Subinterfaces:
  CTRModeCipher, SkippingStreamCipher

All Known Implementing Classes:
  Salsa20Engine, SICBlockCipher

public interface SkippingCipher

Ciphers producing a key stream which can be reset to particular points in the stream implement this.

Method Summary
`long` | `getPosition()` Return the current "position" of the cipher
`long` | `seekTo(long position)` Reset the cipher and then skip forward to a given position.
`long` | `skip(long numberOfBytes)` Skip numberOfBytes forwards, or backwards.

Method Detail

### skip

    public long skip(long numberOfBytes)

  Skip numberOfBytes forwards, or backwards.

  Parameters:
    `numberOfBytes` - the number of bytes to skip (positive forward, negative backwards).
  Returns:
    the number of bytes actually skipped.
  Throws:
    `java.lang.IllegalArgumentException` - if numberOfBytes is an invalid value.

### seekTo

    public long seekTo(long position)

  Reset the cipher and then skip forward to a given position.

  Parameters:
    `position` - the number of bytes in to set the cipher state to.
  Returns:
    the byte position moved to.

### getPosition

    public long getPosition()

  Return the current "position" of the cipher

  Returns:
    the current byte position.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Bouncy Castle Cryptography Library 1.85
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD