SecretKey from byte[]

Is it possible to make a SecretKey using byte[]? I have tried several things, the one that looks most promising is setting the bytes in an InputStream and reading them with ObjectInputStream as a SecretKey. This errors out though with an IOException. Is there another way of doing this? Here is my current code: InputStream keyStream =new ByteArrayInputStream(newbyte[]{70, 76, 87, 95, 99, 71,

53, -101, 68, -7, -63, 4, -121, 14, -2, -87, 28});

SecretKey key =null;

try{

ObjectInputStream ois =new ObjectInputStream(keyStream);

key = (SecretKey) ois.readObject();

ois.close();

}catch (ClassNotFoundException ex){

System.err.println("Error: Class not found.");

}catch (IOException ex){

System.err.println("Unable to read stream.");

}

[1336 byte] By [drawimagea] at [2007-11-27 9:01:40]
# 1
The normal approach isSecretKey secretKey = new SecretKeySpec(keyBytes, ALGORITHM);but I don't know of any ALGORITHM that uses a 17 byte key!
sabre150a at 2007-7-12 21:31:31 > top of Java-index,Java Essentials,Java Programming...
# 2
Whoops, 1 too many numbers. It's supposed to be 16. Thanks for the response sabre150, I'll try that out.
drawimagea at 2007-7-12 21:31:32 > top of Java-index,Java Essentials,Java Programming...