私はDNAタンパク質アラインメントプロジェクト「readseq」に取り組んでいます。その「flybase」パッケージには、コンパイルせずに「typedeprecated」メッセージを表示する「charToByteConverter」クラスを持つJavaコードが含まれています。(http://iubio.bio.indiana.edu/soft/molbio/readseq/java/)。 ここでreadseqソースを見つけることができます。このアプリケーションにさらにいくつかの機能を追加する必要があります。目標に向かって進むためにそれを修正する方法がわかりません。私はJavaの一種の初心者です。可能であれば、Plzが役立ちます。Readseqは、そのGUIを使用してネット上で簡単に入手できます。指定された文字の配列をバイトに変換するだけです。これに関する情報は次のとおりです:(docjar.com/docs/api/sun/io/CharToByteConverter.html)。これが廃止されることについてどうしたらよいかわかりません。これは、以下のように使用される抽象クラスです。
protected byte[] getBytes(CharToByteConverter ctb) {
ctb.reset();
int estLength = ctb.getMaxBytesPerChar() * count;
byte[] result = new byte[estLength];
int length;
try {
length = ctb.convert(value, offset, offset + count,
result, 0, estLength);
length += ctb.flush(result, ctb.nextByteIndex(), estLength);
} catch (CharConversionException e) {
length = ctb.nextByteIndex();
}
if (length < estLength) {
// A short format was used: Trim the byte array.
byte[] trimResult = new byte[length];
System.arraycopy(result, 0, trimResult, 0, length);
return trimResult;
}
else {
return result;
}
}