Skip to content

Package io.github.qishr.cascara.common.io

Class ResourceStream

java.lang.Object
        java.io.InputStream
                io.github.qishr.cascara.common.io.ResourceStream


public final class ResourceStream
extends InputStream

Field Summary

Modifier and Type Field Description
public ContentType contentType
public final InputStream stream

Constructor Summary

Constructor Description
ResourceStream(InputStream stream, ContentType contentType)

Method Summary

Modifier and Type Method Description
public ResourceStream setContentType(ContentType contentType)
public void close()
public int read(byte[] b)
public int read(byte[] b, int off, int len)
public byte[] readAllBytes()
public byte[] readNBytes(int len)
public int readNBytes(byte[] b, int off, int len)
public long skip(long n)
public void skipNBytes(long n)
public int available()
public long transferTo(OutputStream out)
public int read()

Field Details

contentType

public ContentType contentType


stream

public final InputStream stream


Method Details

setContentType

public ResourceStream setContentType(ContentType contentType)


close

public void close()

Throws:

IOException

Overrides:

InputStream


read

public int read(byte[] b)

Throws:

IOException


read

public int read(byte[] b, int off, int len)

Throws:

IOException


readAllBytes

public byte[] readAllBytes()

Throws:

IOException


readNBytes

public byte[] readNBytes(int len)

Throws:

IOException


readNBytes

public int readNBytes(byte[] b, int off, int len)

Throws:

IOException


skip

public long skip(long n)

Throws:

IOException


skipNBytes

public void skipNBytes(long n)

Throws:

IOException


available

public int available()

Throws:

IOException


transferTo

public long transferTo(OutputStream out)

Throws:

IOException


read

public int read()

Throws:

IOException

Overrides:

InputStream