java.io

Class ByteArrayInputStream

Implemented Interfaces:
Closeable

public class ByteArrayInputStream
extends InputStream

A ByteArrayInputStream contains an internal buffer that contains bytes that may be read from the stream. An internal counter keeps track of the next byte to be supplied by the read method.

Closing a ByteArrayInputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

Since:
JDK1.0
See Also:
StringBufferInputStream

Field Summary

protected byte[]
buf
An array of bytes that was provided by the creator of the stream.
protected int
count
The index one greater than the last valid character in the input stream buffer.
protected int
mark
The currently marked position in the stream.
protected int
pos
The index of the next character to read from the input stream buffer.

Constructor Summary

ByteArrayInputStream(buf[] )
Creates a ByteArrayInputStream so that it uses buf as its buffer array.
ByteArrayInputStream(buf[] , int offset, int length)
Creates ByteArrayInputStream that uses buf as its buffer array.

Method Summary

int
available()
Returns the number of bytes that can be read from this input stream without blocking.
void
close()
Closing a ByteArrayInputStream has no effect.
void
mark(int readAheadLimit)
Set the current marked position in the stream.
boolean
markSupported()
Tests if this InputStream supports mark/reset.
int
read()
Reads the next byte of data from this input stream.
int
read(b[] , int off, int len)
Reads up to len bytes of data into an array of bytes from this input stream.
void
reset()
Resets the buffer to the marked position.
long
skip(long n)
Skips n bytes of input from this input stream.

Methods inherited from class java.io.InputStream

available, close, mark, markSupported, read, read, read, reset, skip

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

buf

protected byte[] buf
An array of bytes that was provided by the creator of the stream. Elements buf[0] through buf[count-1] are the only bytes that can ever be read from the stream; element buf[pos] is the next byte to be read.

count

protected int count
The index one greater than the last valid character in the input stream buffer. This value should always be nonnegative and not larger than the length of buf. It is one greater than the position of the last byte within buf that can ever be read from the input stream buffer.

mark

protected int mark
The currently marked position in the stream. ByteArrayInputStream objects are marked at position zero by default when constructed. They may be marked at another position within the buffer by the mark() method. The current buffer position is set to this point by the reset() method.

If no mark has been set, then the value of mark is the offset passed to the constructor (or 0 if the offset was not supplied).

Since:
JDK1.1

pos

protected int pos
The index of the next character to read from the input stream buffer. This value should always be nonnegative and not larger than the value of count. The next byte to be read from the input stream buffer will be buf[pos].

Constructor Details

ByteArrayInputStream

public ByteArrayInputStream(buf[] )
Creates a ByteArrayInputStream so that it uses buf as its buffer array. The buffer array is not copied. The initial value of pos is 0 and the initial value of count is the length of buf.
Parameters:
Usages and Demos :

View More Examples of ByteArrayInputStream(buf[] )
   1:             "<html><head/>\n<body>A GET request</body>\n</html>\n";
   2:         ByteArrayInputStream in = new ByteArrayInputStream(expected.getBytes());
   3: 
   4:         ...
   5:     {
   6:         ByteArrayInputStream in = new ByteArrayInputStream("".getBytes());
   7: 
   8:         String result = IoUtil.getText(in);

View Full Code Here
   1:         
   2:         stream.add(new ByteArrayInputStream("Hello ".getBytes()));
   3:         stream.add(new ByteArrayInputStream(new byte[0]));
   4:         ...
   5:         stream.add(new ByteArrayInputStream("there ".getBytes()));
   6:         ...
   7:         stream.add(new ByteArrayInputStream("garrick".getBytes()));
   8:         stream.add(new ByteArrayInputStream(".".getBytes()));

View Full Code Here
   1:         Oddjob oj = new Oddjob();
   2:         oj.setInput(new ByteArrayInputStream(xml.getBytes()));
   3:         oj.run();
   4:         ...
   5:         Map results = new EnvironmentType().process(
   6:                 new ByteArrayInputStream(x.getBytes()));
   7:         
   8:         ...
   9:         results = new EnvironmentType().process(
  10:                 new ByteArrayInputStream("".getBytes()));
  11:         assertEquals(0, results.size());

View Full Code Here
   1:       {
   2:          return new DataHandler(new StreamSource(new ByteArrayInputStream("<Payroll><Data/></Payroll>".getBytes())), "application/xml");
   3:       }
   4:       catch (Exception e)
   5:       {

View Full Code Here
   1:                this.newValue = new UniFormTreeFragment ();
   2:                ((UniFormTreeFragment)this.newValue).init( new ByteArrayInputStream( "".getBytes()  ) );
   3: 
   4:             } else
   5:                this.newValue = newValue;

View Full Code Here

ByteArrayInputStream

public ByteArrayInputStream(buf[] ,
                            int offset,
                            int length)
Creates ByteArrayInputStream that uses buf as its buffer array. The initial value of pos is offset and the initial value of count is the minimum of offset+length and buf.length. The buffer array is not copied. The buffer's mark is set to the specified offset.
Parameters:
offset - the offset in the buffer of the first byte to read.
length - the maximum number of bytes to read from the buffer.
Usages and Demos :

View More Examples of ByteArrayInputStream(buf[] ,int offset,int length)
   1:     try { 
   2:         ByteArrayInputStream input = new ByteArrayInputStream(arr, off, size);
   3:         ObjectInputStream in = new ObjectInputStream(input);
   4:         return in.readObject();
   5:     } catch (Exception x) { 

View Full Code Here
   1:         final ByteArrayInputStream stream =
   2:             new ByteArrayInputStream( attr.b, attr.off, attr.len );
   3:         try
   4:         {
   5:             m_classDescriptor = MetaClassIOBinary.IO.

View Full Code Here
   1:             multicastSocket.receive(recv);
   2:             ips = new ByteArrayInputStream(buf, 0, buf.length);
   3:             ois = new ObjectInputStream(ips);
   4:             ReplicationWrapper obj = (ReplicationWrapper)ois.readObject();

View Full Code Here
   1:                 buf = repObj.getDataStream();
   2:                 bis = new ByteArrayInputStream(buf, 0, buf.length);
   3: 
   4:                 if (container != null)
   5:                     loader = container.getLoader();

View Full Code Here
   1:       throw new KeyAgreementException("message size limit exceeded");
   2:     in = new ByteArrayInputStream(b, 4, length);
   3:   }
   4:         ...
   5:     IncomingMessage result = new IncomingMessage();
   6:     result.in = new ByteArrayInputStream(raw, offset, len);
   7:     return result;
   8:   }

View Full Code Here

Method Details

available

public int available()
Returns the number of bytes that can be read from this input stream without blocking. The value returned is count - pos, which is the number of bytes remaining to be read from the input buffer.
Overrides:
available in interface InputStream
Returns:
the number of bytes that can be read from the input stream without blocking.
Usages and Demos :

View More Examples of available()
   1:         ByteArrayOutputStream baos;
   2:         ByteArrayInputStream bais;
   3:         boolean pass;
   4:         ...
   5:         beginTest("Decode encrypted data");
   6:             bais = new ByteArrayInputStream(baos.toByteArray() );
   7:             elgamal.decodeEncryptedData(new PGPWrapperDataInputStream(bais));
   8:         ...
   9:         passIf(bais.available() == 0);
  10:         

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:     String _encoding=StringUtil.__UTF8;
   6:     ByteArrayInputStream _bin = new ByteArrayInputStream(new byte[0]);
   7:     ByteArrayOutputStream _bout = new ByteArrayOutputStream();
   8:         ...
   9:     {
  10:         return _bin.available()>0;
  11:     }   

View Full Code Here
   1: import java.io.ByteArrayOutputStream;
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ObjectOutputStream;
   4:         ...
   5:         }
   6:         ByteArrayInputStream is  
   7:         ...
   8:             = new ByteArrayInputStream( cont, pos, rem );
   9:         ...
  10:         int read = is.available();

View Full Code Here
   1:         Enumeration e;
   2:         ByteArrayInputStream in;
   3: 
   4:         ...
   5:                 if (e.hasMoreElements()) {
   6:                     in = new ByteArrayInputStream((byte[]) e.nextElement());
   7:                 } else {
   8:         ...
   9:                 if (e.hasMoreElements()) {
  10:                     in = new ByteArrayInputStream((byte[]) e.nextElement());
  11:                 } else {
  12:         ...
  13:             }
  14:             return in.available();

View Full Code Here
   1: import java.io.ByteArrayOutputStream;
   2: import java.io.ByteArrayInputStream;
   3: 
   4:         ...
   5:     
   6:     private ByteArrayInputStream encodedInputStream_;
   7:     
   8:         ...
   9: 
  10:     private ByteArrayInputStream reEncode(Reader reader) 
  11:     throws IOException
  12:         ...
  13: 
  14:     return encodedInputStream_.available();

View Full Code Here

close

public void close()
            throws IOException
Closing a ByteArrayInputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

Specified by:
close in interface Closeable
Overrides:
close in interface InputStream
Usages and Demos :

View More Examples of close()
   1:     byte[] buff=new byte[]{2,15,67,-1,-9,9};
   2:     ByteArrayInputStream in=new ByteArrayInputStream(buff,1,4);
   3:     int data=in.read();
   4:     while(data!=-1){
   5:       System.out.print(data +" ");

View Full Code Here
   1:     new ObjectOutputStream( baos ).writeObject( o );
   2:     baos.close();
   3:     
   4:         ...
   5:     ByteArrayInputStream bais = new ByteArrayInputStream( baos.toByteArray() );
   6:     Object p = new ObjectInputStream(bais).readObject();
   7:         ...
   8:     bais.close();
   9:     

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:         
   6:         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
   7:         ObjectInputStream ois = new ObjectInputStream(bais);
   8:         ...
   9:         DyeLaser test = (DyeLaser) ois.readObject();
  10:         baos.close();
  11:         ...
  12:         oos.close();

View Full Code Here
   1: import java.beans.XMLEncoder;
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:         enc.writeObject(val);
   6:         enc.close();
   7:         ...
   8:         try{baos.close();} catch(Exception e) {}
   9:         return baos.toByteArray();
  10:         ...
  11:     {
  12:         final ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: 
   4:         ...
   5:         
   6:        ByteArrayInputStream stream = null;
   7:         try {
   8:         ...
   9:             stream = new ByteArrayInputStream(xml.getBytes());
  10:         
  11:         ...
  12:         }finally {
  13:             try{ stream.close(); }catch( Exception ex){}

View Full Code Here

mark

public void mark(int readAheadLimit)
Set the current marked position in the stream. ByteArrayInputStream objects are marked at position zero by default when constructed. They may be marked at another position within the buffer by this method.

If no mark has been set, then the value of the mark is the offset passed to the constructor (or 0 if the offset was not supplied).

Note: The readAheadLimit for this class has no meaning.

Overrides:
mark in interface InputStream
Since:
JDK1.1
Usages and Demos :

View More Examples of mark(int readAheadLimit)
   1: public class SimpleInputBuffer extends DataInputStream implements InputBuffer {
   2:   ByteArrayInputStream bais;
   3: 
   4:         ...
   5:   public SimpleInputBuffer(byte[] bytes) {
   6:     super(new ByteArrayInputStream(bytes));
   7:         ...
   8:     bais = (ByteArrayInputStream) this.in;
   9:   }
  10:         ...
  11:   public short peakShort() throws IOException {
  12:     bais.mark(2);

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:       }
   6:       ByteArrayDSInputStream stream = new ByteArrayDSInputStream(new ByteArrayInputStream(_data), this);
   7:       if (_inputStreams == null)
   8:         ...
   9:    {
  10:       private ByteArrayInputStream _stream = null;
  11:       private ByteArrayDataSource _owner = null;
  12:         ...
  13:       {
  14:          _stream.mark(readAheadLimit);

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:         this.getMetaData().setContentBegin(headerBytes.length);
   6:         ByteArrayInputStream bais =
   7:         ...
   8:             new ByteArrayInputStream(headerBytes);
   9:         if (!bais.markSupported()) {
  10:         ...
  11:         }
  12:         bais.mark(headerBytes.length);

View Full Code Here
   1:         RawDataBlock[]       rawBlocks = new RawDataBlock[ blocks ];
   2:         ByteArrayInputStream stream    =
   3:         ...
   4:             new ByteArrayInputStream(_workbook_data);
   5: 
   6:         ...
   7:         stream.read(buffer);
   8:         stream.mark(12);
   9:         stream.read(buffer);

View Full Code Here
   1:   public SocketBuffer(byte[] input, SocketPastryNode spn) throws IOException {
   2:     str = new SocketDataInputStream(new ByteArrayInputStream(input));
   3:     nhf = spn;
   4:         ...
   5:     str = new SocketDataInputStream(
   6:       new ByteArrayInputStream(buffer.array()));
   7: 
   8:         ...
   9:     InputBuffer {
  10:     ByteArrayInputStream bais;
  11: 
  12:         ...
  13:     public short peakShort() throws IOException {
  14:       bais.mark(2);

View Full Code Here

markSupported

public boolean markSupported()
Tests if this InputStream supports mark/reset. The markSupported method of ByteArrayInputStream always returns true.
Overrides:
markSupported in interface InputStream
Since:
JDK1.1
Usages and Demos :

View More Examples of markSupported()
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:       }
   6:       ByteArrayDSInputStream stream = new ByteArrayDSInputStream(new ByteArrayInputStream(_data), this);
   7:       if (_inputStreams == null)
   8:         ...
   9:    {
  10:       private ByteArrayInputStream _stream = null;
  11:       private ByteArrayDataSource _owner = null;
  12:         ...
  13:       {
  14:          return _stream.markSupported();

View Full Code Here

read

public int read()
Reads the next byte of data from this input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned.

This read method cannot block.

Overrides:
read in interface InputStream
Returns:
the next byte of data, or -1 if the end of the stream has been reached.
Usages and Demos :

View More Examples of read()
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.IOException;
   4:         ...
   5:         offsets = new int[numGlyphs + 1];
   6:         ByteArrayInputStream bais = new ByteArrayInputStream(buf);
   7:         if (shortEntries) {
   8:         ...
   9:             for (int i = 0; i <= numGlyphs; i++) {
  10:                 offsets[i] = (bais.read()<<8 | bais.read());
  11:             }
  12:         ...
  13:             for (int i = 0; i <= numGlyphs; i++) {
  14:                 offsets[i] = (bais.read()<<24 | bais.read()<<16 | 

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.IOException;
   4:         ...
   5:         hMetrics = new int[numberOfHMetrics];
   6:         ByteArrayInputStream bais = new ByteArrayInputStream(buf);
   7:         for (int i = 0; i < numberOfHMetrics; i++) {
   8:         ...
   9:             hMetrics[i] = (bais.read()<<24 | bais.read()<<16 | 
  10:         ...
  11:                            bais.read()<< 8 | bais.read());

View Full Code Here
   1: import java.io.ByteArrayOutputStream;
   2: import java.io.ByteArrayInputStream;
   3: 
   4:         ...
   5:     
   6:     private ByteArrayInputStream encodedInputStream_;
   7:     
   8:         ...
   9: 
  10:     private ByteArrayInputStream reEncode(Reader reader) 
  11:     throws IOException
  12:         ...
  13:     
  14:     int c = encodedInputStream_.read();

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.IOException;
   4:         ...
   5:         descript = new GlyfDescript[numGlyphs];
   6:         ByteArrayInputStream bais = new ByteArrayInputStream(buf);
   7:         for (int i = 0; i < numGlyphs; i++) {
   8:         ...
   9:                 bais.skip(loca.getOffset(i));
  10:                 short numberOfContours = (short)(bais.read()<<8 | bais.read());
  11:                 if (numberOfContours >= 0) {
  12:         ...
  13:                 bais.skip(loca.getOffset(i));
  14:                 short numberOfContours = (short)(bais.read()<<8 | bais.read());

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:             if (val[i] != (byte) 0x00) break;
   6:         ByteArrayInputStream bais = new ByteArrayInputStream(val, i, val.length - i);
   7:         Hash hash = new Hash();
   8:         byte rv[] = null;
   9:         try {

View Full Code Here

read

public int read(b[] ,
                int off,
                int len)
Reads up to len bytes of data into an array of bytes from this input stream. If pos equals count, then -1 is returned to indicate end of file. Otherwise, the number k of bytes read is equal to the smaller of len and count-pos. If k is positive, then bytes buf[pos] through buf[pos+k-1] are copied into b[off] through b[off+k-1] in the manner performed by System.arraycopy. The value k is added into pos and k is returned.

This read method cannot block.

Overrides:
read in interface InputStream
Parameters:
off - the start offset of the data.
len - the maximum number of bytes read.
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
Usages and Demos :

View More Examples of read(b[] ,int off,int len)
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:         ByteArrayInputStream bais = new ByteArrayInputStream(fromNetwork);
   7:         byte[] vendorID = null, restOf = null;
   8:         ...
   9:             vendorID = new byte[4];
  10:             bais.read(vendorID, 0, vendorID.length);
  11:             selector = ByteOrder.ushort2int(ByteOrder.leb2short(bais));
  12:         ...
  13:             restOf = new byte[bais.available()];
  14:             bais.read(restOf, 0, restOf.length);

View Full Code Here
   1: import java.io.InputStream;
   2: import java.io.ByteArrayInputStream;
   3: import java.io.IOException;
   4:         ...
   5:     {
   6:         int val = currentBuffer.read(b, off, len);
   7:         
   8:         ...
   9:                 reader.readLOBContinuationStream();
  10:             val = currentBuffer.read(b, off, len);
  11:             
  12:         ...
  13:     
  14:     private ByteArrayInputStream currentBuffer;

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:       }
   6:       ByteArrayDSInputStream stream = new ByteArrayDSInputStream(new ByteArrayInputStream(_data), this);
   7:       if (_inputStreams == null)
   8:         ...
   9:    {
  10:       private ByteArrayInputStream _stream = null;
  11:       private ByteArrayDataSource _owner = null;
  12:         ...
  13:          }
  14:          return _stream.read(b, off, len);

View Full Code Here
   1: import java.io.InputStream;
   2: import java.io.ByteArrayInputStream;
   3: import java.io.IOException;
   4:         ...
   5:         }
   6:         int val = currentBuffer.read(b, off, len);
   7:         if (val < 0) {
   8:         ...
   9:                 reader.readLOBContinuationStream(remainingBytes);
  10:             val = currentBuffer.read(b, off, len);
  11:         }
  12:         ...
  13:     
  14:     private ByteArrayInputStream currentBuffer;

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:       ByteArrayInputStream in = new ByteArrayInputStream(ObjectUtils.serialize(msg));
   7:       int pos = 0;
   8:         ...
   9: 
  10:         int len = in.read(buffer, offset + headerLen, maxLen);
  11:         pack.setDataLength(len + headerLen);

View Full Code Here

reset

public void reset()
Resets the buffer to the marked position. The marked position is 0 unless another position was marked or an offset was specified in the constructor.
Overrides:
reset in interface InputStream
Usages and Demos :

View More Examples of reset()
   1: public class SimpleInputBuffer extends DataInputStream implements InputBuffer {
   2:   ByteArrayInputStream bais;
   3: 
   4:         ...
   5:   public SimpleInputBuffer(byte[] bytes) {
   6:     super(new ByteArrayInputStream(bytes));
   7:         ...
   8:     bais = (ByteArrayInputStream) this.in;
   9:   }
  10:         ...
  11:     short temp = readShort();
  12:     bais.reset();

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:                 getTmpDir(), "testReadFullyOrUntil").getAbsolutePath()));
   6:         ByteArrayInputStream bais = new ByteArrayInputStream(
   7:                 "abcdefghijklmnopqrstuvwxyz".getBytes());
   8:         ...
   9:         assertEquals("soft max cutoff","abcdefg",new String(baos.toByteArray()));
  10:         bais.reset();
  11:         ...
  12:         baos.reset();

View Full Code Here
   1: 
   2:       ByteArrayInputStream inputStream =
   3:         ...
   4:               new ByteArrayInputStream(test_url.getBytes());
   5: 
   6:         ...
   7: 
   8:       inputStream.reset();
   9:       outputStream.close();

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.IOException;
   4:         ...
   5:         descript = new GlyfDescript[numGlyphs];
   6:         ByteArrayInputStream bais = new ByteArrayInputStream(buf);
   7:         for (int i = 0; i < numGlyphs; i++) {
   8:         ...
   9:             if (len > 0) {
  10:                 bais.reset();
  11:                 bais.skip(loca.getOffset(i));
  12:         ...
  13:             if (len > 0) {
  14:                 bais.reset();

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:   
   6:   private static ByteArrayInputStream createInput() throws IOException
   7:   {
   8:         ...
   9:     
  10:     return new ByteArrayInputStream(buf);
  11:   }
  12:         ...
  13:       ops += BYTE_COUNT;
  14:       bin.reset();

View Full Code Here

skip

public long skip(long n)
Skips n bytes of input from this input stream. Fewer bytes might be skipped if the end of the input stream is reached. The actual number k of bytes to be skipped is equal to the smaller of n and count-pos. The value k is added into pos and k is returned.
Overrides:
skip in interface InputStream
Parameters:
n - the number of bytes to be skipped.
Returns:
the actual number of bytes skipped.
Usages and Demos :

View More Examples of skip(long n)
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.IOException;
   4:         ...
   5:         descript = new GlyfDescript[numGlyphs];
   6:         ByteArrayInputStream bais = new ByteArrayInputStream(buf);
   7:         for (int i = 0; i < numGlyphs; i++) {
   8:         ...
   9:                 bais.reset();
  10:                 bais.skip(loca.getOffset(i));
  11:                 short numberOfContours = (short)(bais.read()<<8 | bais.read());
  12:         ...
  13:                 bais.reset();
  14:                 bais.skip(loca.getOffset(i));

View Full Code Here
   1:         ByteArrayOutputStream out = new ByteArrayOutputStream();
   2:         ByteArrayInputStream bis = new ByteArrayInputStream(data);
   3:         Header header = new Header();
   4:         ...
   5:         header.read(data, pos);
   6:         bis.skip(pos + header.getSize());
   7:         InflaterInputStream inflater = new InflaterInputStream( bis );
   8:         byte[] chunk = new byte[4096];
   9:         int count;

View Full Code Here
   1: 
   2: import java.io.ByteArrayInputStream;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:       }
   6:       ByteArrayDSInputStream stream = new ByteArrayDSInputStream(new ByteArrayInputStream(_data), this);
   7:       if (_inputStreams == null)
   8:         ...
   9:    {
  10:       private ByteArrayInputStream _stream = null;
  11:       private ByteArrayDataSource _owner = null;
  12:         ...
  13:       {
  14:          return _stream.skip(n);

View Full Code Here
   1: import com.arjuna.ats.arjuna.common.*;
   2: import java.io.ByteArrayInputStream;
   3: import java.io.DataInputStream;
   4:         ...
   5:     {
   6:         _inputStream = new ByteArrayInputStream(_byteArray);
   7:         _input = new DataInputStream(_inputStream);
   8:         ...
   9:         {
  10:         _inputStream = new ByteArrayInputStream(_byteArray);
  11:         _input = new DataInputStream(_inputStream);
  12:         ...
  13:     
  14:     _inputStream.skip(3);

View Full Code Here
   1:         RawDataBlock[]       rawBlocks = new RawDataBlock[ blocks ];
   2:         ByteArrayInputStream stream    =
   3:         ...
   4:             new ByteArrayInputStream(_workbook_data);
   5: 
   6:         ...
   7:         {
   8:             assertEquals(_buffer_size, stream.skip(_buffer_size));
   9:             count -= _buffer_size;
  10:         ...
  11:         assertEquals(_workbook_size % _buffer_size,
  12:                      stream.skip(_buffer_size));

View Full Code Here