Apime v1.0

com.java4ever.apime.io
Class DataArrayInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.DataInputStream
          extended bycom.java4ever.apime.io.DataArrayInputStream
All Implemented Interfaces:
java.io.DataInput

public class DataArrayInputStream
extends java.io.DataInputStream

Stream de lectura de un array de bytes.


Field Summary
protected  byte[] data
          Array de bytes.
 
Fields inherited from class java.io.DataInputStream
in
 
Constructor Summary
DataArrayInputStream(byte[] data)
          Crea el stream para un array de bytes.
 
Method Summary
 byte[] getData()
          Devuelve el array de bytes con el que se ha creado el stream.
 byte[] readData()
          Devuelve un array con los datos que quedan por leer.
 byte[] readData(int limit)
          Devuelve un array con los datos leídos.
 
Methods inherited from class java.io.DataInputStream
available, close, mark, markSupported, read, read, read, readBoolean, readByte, readChar, readFully, readFully, readInt, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, reset, skip, skipBytes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected byte[] data
Array de bytes.

Constructor Detail

DataArrayInputStream

public DataArrayInputStream(byte[] data)
Crea el stream para un array de bytes.

Parameters:
data - Array de byte
Method Detail

getData

public byte[] getData()
Devuelve el array de bytes con el que se ha creado el stream.


readData

public byte[] readData()
                throws java.io.IOException
Devuelve un array con los datos que quedan por leer.

Returns:
Si no se ha leído nada devuelve el array de bytes con el que se ha creado el stream
Throws:
java.io.IOException

readData

public byte[] readData(int limit)
                throws java.io.IOException
Devuelve un array con los datos leídos.

Parameters:
limit - Número máximo de bytes a leer
Returns:
Si no se ha leído nada y 'limit>=data.length' devuelve el array de bytes con el que se ha creado el stream
Throws:
java.io.IOException

Apime v1.0

Copyright 2004 Java4Ever.com. All Rights Reserved.