public class ByteArrayInputStream extends InputStream
ByteArrayInputStream替换方案。本代码移植自IBM developer works文章:
| Constructor and Description |
|---|
ByteArrayInputStream(byte[] data) |
ByteArrayInputStream(byte[] data,
int offset,
int length) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
void |
mark(int readLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] data,
int offset,
int length) |
void |
reset() |
long |
skip(long amount) |
readpublic ByteArrayInputStream(byte[] data)
public ByteArrayInputStream(byte[] data,
int offset,
int length)
public int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] data,
int offset,
int length)
throws IOException
read in class InputStreamIOExceptionpublic long skip(long amount)
throws IOException
skip in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class InputStreampublic void mark(int readLimit)
mark in class InputStreampublic void reset()
throws IOException
reset in class InputStreamIOExceptionpublic boolean markSupported()
markSupported in class InputStreamCopyright © 2006–2018 TinyGroup. All rights reserved.