org.apache.derby.iapi.services.io
Class NewByteArrayInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.derby.iapi.services.io.NewByteArrayInputStream
All Implemented Interfaces:
java.io.Closeable

public final class NewByteArrayInputStream
extends java.io.InputStream

An InputStream that is like java.io.ByteArrayInputStream but supports a close() call that causes all methods to throw an IOException. Java's ByteInputStream has a close() method that does not do anything.


Field Summary
private  byte[] data
           
private  int length
           
private  int offset
           
 
Constructor Summary
NewByteArrayInputStream(byte[] data)
           
NewByteArrayInputStream(byte[] data, int offset, int length)
           
 
Method Summary
 int available()
           
 void close()
           
 byte[] getData()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 long skip(long count)
           
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private byte[] data

offset

private int offset

length

private int length
Constructor Detail

NewByteArrayInputStream

public NewByteArrayInputStream(byte[] data)

NewByteArrayInputStream

public NewByteArrayInputStream(byte[] data,
                               int offset,
                               int length)
Method Detail

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

skip

public long skip(long count)
          throws java.io.IOException
Overrides:
skip in class java.io.InputStream
Throws:
java.io.IOException

available

public int available()
              throws java.io.IOException
Overrides:
available in class java.io.InputStream
Throws:
java.io.IOException

getData

public byte[] getData()

close

public void close()
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.