sábado, 7 de mayo de 2011

Convertir un Byte Array a InputStream

byte[] bytes = ... //get byte array from somewhere.

InputStream input = new ByteArrayInputStream(bytes);

int data = input.read();
while(data != -1) {
//do something with data

data = input.read();
}
input.close();


Note: The proper exception handling has been skipped here for the sake of clarity. To learn more about correct exception handling, go to Java IO Exception Handling.

Obtener más información del tema

No hay comentarios:

Publicar un comentario