Пишу библиотеку для паскаля и ява ешё мало понятна!Немогу понять уже два дня,почему не передать байты в другой массив?В итоге файл пуст!
public public static void read_rs(String name, String info)
{
try
{
FileConnection fs = (FileConnection)Connector.open("file://" + info);
if(!fs.exists())
fs.create();
DataOutputStream os = fs.openDataOutputStream();
RecordStore myStore = RecordStore.openRecordStore(name, true);
StringBuffer f = new StringBuffer();
byte[] data = null;
byte[] d = null;
RecordEnumeration rc = myStore.enumerateRecords(null, null, true);
rc.rebuild();
int x = 0;
for(int i = 1; i <= rc.numRecords(); i++)
{
data = rc.nextRecord();
for(int c = 0; c <= 255; c++)
{ d[x] = data[c];
x =x+1; }
}
os.write(d, 0, d.length);
myStore.closeRecordStore();
os.flush();
os.close();
}
|
Помогите начинаюшему!