()
| 28 | } |
| 29 | |
| 30 | private void readHeader() |
| 31 | throws DBException, IOException |
| 32 | { |
| 33 | byte[] buffer = new byte[20]; |
| 34 | int count = this.in.read(buffer); |
| 35 | if (count != buffer.length) { |
| 36 | throw new DBException("TLK header truncated"); |
| 37 | } |
| 38 | String type = new String(buffer, 0, 4); |
| 39 | String version = new String(buffer, 4, 4); |
| 40 | if (!type.equals("TLK ")) { |
| 41 | throw new DBException(new StringBuilder().append("File type '").append(type).append("' is not supported").toString()); |
| 42 | } |
| 43 | if (!version.equals("V3.0")) { |
| 44 | throw new DBException(new StringBuilder().append("File version '").append(version).append("' is not supported").toString()); |
| 45 | } |
| 46 | this.languageID = getInteger(buffer, 8); |
| 47 | this.stringCount = getInteger(buffer, 12); |
| 48 | this.entryOffset = 20; |
| 49 | this.stringOffset = getInteger(buffer, 16); |
| 50 | } |
| 51 | |
| 52 | public String getName() |
| 53 | { |
no test coverage detected