diff options
Diffstat (limited to 'songdbj/org/tritonus/share/sampled/file/TSeekableDataOutputStream.java')
-rw-r--r-- | songdbj/org/tritonus/share/sampled/file/TSeekableDataOutputStream.java | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/songdbj/org/tritonus/share/sampled/file/TSeekableDataOutputStream.java b/songdbj/org/tritonus/share/sampled/file/TSeekableDataOutputStream.java new file mode 100644 index 0000000000..6f688c5b2e --- /dev/null +++ b/songdbj/org/tritonus/share/sampled/file/TSeekableDataOutputStream.java | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * TSeekableDataOutputStream.java | ||
3 | * | ||
4 | * This file is part of Tritonus: http://www.tritonus.org/ | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * Copyright (c) 1999 by Florian Bomers <http://www.bomers.de> | ||
9 | * Copyright (c) 2000 by Matthias Pfisterer | ||
10 | * | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU Library General Public License as published | ||
14 | * by the Free Software Foundation; either version 2 of the License, or | ||
15 | * (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU Library General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU Library General Public | ||
23 | * License along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
25 | * | ||
26 | */ | ||
27 | |||
28 | /* | ||
29 | |<--- this code is formatted to fit into 80 columns --->| | ||
30 | */ | ||
31 | |||
32 | package org.tritonus.share.sampled.file; | ||
33 | |||
34 | import java.io.File; | ||
35 | import java.io.RandomAccessFile; | ||
36 | import java.io.IOException; | ||
37 | |||
38 | |||
39 | |||
40 | /** | ||
41 | * A TDataOutputStream that allows seeking. | ||
42 | * | ||
43 | * @author Florian Bomers | ||
44 | * @author Matthias Pfisterer | ||
45 | */ | ||
46 | public class TSeekableDataOutputStream | ||
47 | extends RandomAccessFile | ||
48 | implements TDataOutputStream | ||
49 | { | ||
50 | public TSeekableDataOutputStream(File file) | ||
51 | throws IOException | ||
52 | { | ||
53 | super(file, "rw"); | ||
54 | } | ||
55 | |||
56 | |||
57 | |||
58 | public boolean supportsSeek() | ||
59 | { | ||
60 | return true; | ||
61 | } | ||
62 | |||
63 | |||
64 | |||
65 | public void writeLittleEndian32(int value) | ||
66 | throws IOException | ||
67 | { | ||
68 | writeByte(value & 0xFF); | ||
69 | writeByte((value >> 8) & 0xFF); | ||
70 | writeByte((value >> 16) & 0xFF); | ||
71 | writeByte((value >> 24) & 0xFF); | ||
72 | } | ||
73 | |||
74 | |||
75 | |||
76 | public void writeLittleEndian16(short value) | ||
77 | throws IOException | ||
78 | { | ||
79 | writeByte(value & 0xFF); | ||
80 | writeByte((value >> 8) & 0xFF); | ||
81 | } | ||
82 | } | ||
83 | |||
84 | |||
85 | |||
86 | /*** TSeekableDataOutputStream.java ***/ | ||