- 621 名前:デフォルトの名無しさん [2007/07/15(日) 12:13:26 ]
- データの読み込みについて質問です。
一度ByteにしてArrayListに格納して、取り出してbyteに変換しています。 もっとスマートな方法(このクラスを使った方が良い等)があれば教えて頂けないでしょうか。 ArrayList byteArray = new ArrayList(); int readByte = 0; while (readByte != -1) { readByte = stream.read(); if (readByte != -1) { byteArray.add(new Byte((byte) readByte)); } } Byte[] byteBig = (Byte[]) byteArray.toArray(new Byte[0]); byte[] byteTmp = new byte[byteBig.length]; for (int i = 0; i < byteBig.length; i++) { byteTmp[i] = byteBig[i].byteValue(); }
|

|