Package com.cedarsoftware.util
Class FastByteArrayInputStream
java.lang.Object
java.io.InputStream
com.cedarsoftware.util.FastByteArrayInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Faster version of ByteArrayInputStream that does not have synchronized methods.
- Author:
- John DeRegnaucourt ([email protected])
Copyright (c) Cedar Software LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
License
Unless required by applicable law or agreed to in writing, software distributed under the License 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.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
read
-
Constructor Details
-
FastByteArrayInputStream
public FastByteArrayInputStream(byte[] buf)
-
-
Method Details
-
read
public int read()- Specified by:
read
in classInputStream
-
read
public int read(byte[] b, int off, int len) - Overrides:
read
in classInputStream
-
skip
public long skip(long n) - Overrides:
skip
in classInputStream
-
available
public int available()- Overrides:
available
in classInputStream
-
mark
public void mark(int readLimit) - Overrides:
mark
in classInputStream
-
reset
public void reset()- Overrides:
reset
in classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-