?? fileheader.java
字號:
package org.galaxy_OPEN.www.datastructures.huffman;
import java.io.*;
public class FileHeader implements Serializable {
private String originalFileName;
private long numBytes;
private Node huffmanTree;
public FileHeader(String name, long nbBytes, Node huffTree) {
originalFileName = name;
numBytes = nbBytes;
this.huffmanTree = huffTree;
}
public String getOriginalFileName() {
return originalFileName;
}
public long getNumBytes() {
return numBytes;
}
public Node getHuffmanTree() {
return huffmanTree;
}
public long headerLength() throws FileNotFoundException, IOException {
long size = -1;
File temp = File.createTempFile("header", ".tmp");
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(
temp));
oos.writeObject(this);
oos.flush();
oos.close();
size = temp.length();
temp.delete();
return size;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -