Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2013-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   *
   *  http://aws.amazon.com/apache2.0
   *
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.s3.internal.crypto;
 
A specific kind of CipherLiteInputStream that supports partial mark-and-reset in the sense that, if the underlying input stream supports mark-and-reset, this input stream can then be marked at and get reset back to the very beginning of the stream (but not anywhere else).
 
 public final class RenewableCipherLiteInputStream extends CipherLiteInputStream {
     private boolean hasBeenAccessed;
 
     public RenewableCipherLiteInputStream(InputStream isCipherLite cipherLite) {
         super(iscipherLite);
     }
 
             int buffsize) {
         super(iscbuffsize);
     }
 
             int buffsizeboolean multipartboolean lastMultiPart) {
         super(iscbuffsizemultipartlastMultiPart);
     }
 
     protected RenewableCipherLiteInputStream(InputStream is) {
         super(is);
     }

    
Mark and reset is currently only partially supported, in the sense that, if the underlying input stream supports mark-and-reset, this input stream can then be marked at and get reset back to the very beginning of the stream (but not anywhere else).
 
     @Override
     public boolean markSupported() {
         abortIfNeeded();
         return .markSupported();
     }

    
Mark and reset is currently only partially supported, in the sense that, if the underlying input stream supports mark-and-reset, this input stream can then be marked at and get reset back to the very beginning of the stream (but not anywhere else).

Throws:
java.lang.UnsupportedOperationException if mark is called after this stream has been accessed.
 
     @Override
     public void mark(final int readlimit) {
         abortIfNeeded();
         if () {
             throw new UnsupportedOperationException(
                     "Marking is only supported before your first call to "
                             + "read or skip.");
         }
         .mark(readlimit);
     }

    
Resets back to the very beginning of the stream.

Mark and reset is currently only partially supported, in the sense that, if the underlying input stream supports mark-and-reset, this input stream can then be marked at and get reset back to the very beginning of the stream (but not anywhere else).

 
     @Override
     public void reset() throws IOException {
         abortIfNeeded();
         .reset();
         renewCipherLite();
         resetInternal();
          = false;
     }
 
     @Override
     public int read() throws IOException {
          = true;
         return super.read();
    }
    @Override
    public int read(final byte[] bthrows IOException {
         = true;
        return super.read(b);
    }
    @Override
    public int read(final byte[] bfinal int offfinal int len)
            throws IOException {
         = true;
        return super.read(bofflen);
    }
    @Override
    public long skip(final long nthrows IOException {
         = true;
        return super.skip(n);
    }
New to GrepCode? Check out our FAQ X