com.bumptech.glide.util
Class MarkEnforcingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.bumptech.glide.util.MarkEnforcingInputStream
All Implemented Interfaces:
Closeable

public class MarkEnforcingInputStream
extends FilterInputStream

Prevents InputStreams from overflowing their buffer by reading data past their read limit.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
MarkEnforcingInputStream(InputStream in)
           
 
Method Summary
 int available()
           
 void mark(int readlimit)
           
 int read()
           
 int read(byte[] buffer, int byteOffset, int byteCount)
           
 void reset()
           
 long skip(long byteCount)
           
 
Methods inherited from class java.io.FilterInputStream
close, markSupported, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkEnforcingInputStream

public MarkEnforcingInputStream(InputStream in)
Method Detail

mark

public void mark(int readlimit)
Overrides:
mark in class FilterInputStream

read

public int read()
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] buffer,
                int byteOffset,
                int byteCount)
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

reset

public void reset()
           throws IOException
Overrides:
reset in class FilterInputStream
Throws:
IOException

skip

public long skip(long byteCount)
          throws IOException
Overrides:
skip in class FilterInputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class FilterInputStream
Throws:
IOException