|
public class Export2BIFF{
// interne Variablen fuer das Speichern
private FileOutputStream fout;
private DataOutputStream dout;
private String filename;
// Felder Beginn Ende String Int
byte [] CXlsBof = { 9, 8, 8, 0, 0, 0, 0x10, 0, 1, 0, 0, 0 };
byte [] CXlsEof = {0x0A, 0, 0, 0};
byte [] CXlsString = new byte[12];
byte [] CXlsDouble = new byte[10];
byte [] CXlsInt = new byte[10];
public Export2BIFF(String filename) {
this.filename = filename;
ClearArrays();
} // Export2BIFF
public void openFile() {
try {
fout = new FileOutputStream(filename);
dout = new DataOutputStream(fout);
for (int i=0; i> 8) & 255); // 4 5 [2]
s = (short) (Col);
CXlsInt[6] = (byte) (s & 255); // 6 7 [3]
CXlsInt[7] = (byte) ((s >> 8) & 255); // 6 7 [3]
writeCXlsInt();
// Trennung der Bytes, à Resim
v = (iValue << 2) | 2;
i0 = (byte) (v & 255);
i1 = (byte) ((v >> 8) & 255);
i2 = (byte) ((v >> 16) & 255);
i3 = (byte) ((v >> 24) & 255);
dout.writeByte( i0 );
dout.writeByte( i1 );
dout.writeByte( i2 );
dout.writeByte( i3 );
}
catch (IOException e) {
System.err.println("IOException: " + e);
}
} // Write Int
// schreiben der Vorspann eines double
private void writeCXlsDouble() {
try {
for (int i=0; i> 8) & 255); // 4 5 [2]
s = (short) (Col);
CXlsDouble[6] = (byte) (s & 255); // 6 7 [3]
CXlsDouble[7] = (byte) ((s >> 8) & 255); // 6 7 [3]
writeCXlsDouble();
// Konvertierung in long, auftrennen der einzelnen Bytes der ACHT Double-Bytes !!!!
// Tja, sowas gibt es in jaaaava
long lD = Double.doubleToLongBits(dValue);
int ofs;
for (i=0, ofs=0; i> ofs) & 255); // GDI 1 Resim
}
for (i=0; i> 8) & 255); // 2 3
s = (short) (Row);
CXlsString[4] = (byte) (s & 255); // 4 5 [2]
CXlsString[5] = (byte) ((s >> 8) & 255); // 4 5 [2]
s = (short) (Col);
CXlsString[6] = (byte) (s & 255); // 6 7 [3]
CXlsString[7] = (byte) ((s >> 8) & 255); // 6 7 [3]
s = (short) (len);
CXlsString[10] = (byte) (s & 255); // 10 11 [5]
CXlsString[11] = (byte) ((s >> 8) & 255); // 10 11 [5]
writeCXlsString();
for (int i=0; i
|
|