summaryrefslogtreecommitdiff
path: root/songdbj/org/tritonus/share/sampled/file/TSeekableDataOutputStream.java
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-07-11 15:42:37 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-07-11 15:42:37 +0000
commit9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e (patch)
tree4c304cd4151020bd5494d279ee68a105ae3a5a3a /songdbj/org/tritonus/share/sampled/file/TSeekableDataOutputStream.java
parentdfa8ecbe609ca8ea194d08560a44fb9a92e94b4b (diff)
downloadrockbox-9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e.tar.gz
rockbox-9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e.zip
Songdb java version, source. only 1.5 compatible
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7101 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'songdbj/org/tritonus/share/sampled/file/TSeekableDataOutputStream.java')
-rw-r--r--songdbj/org/tritonus/share/sampled/file/TSeekableDataOutputStream.java86
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
32package org.tritonus.share.sampled.file;
33
34import java.io.File;
35import java.io.RandomAccessFile;
36import java.io.IOException;
37
38
39
40/**
41 * A TDataOutputStream that allows seeking.
42 *
43 * @author Florian Bomers
44 * @author Matthias Pfisterer
45 */
46public class TSeekableDataOutputStream
47extends RandomAccessFile
48implements 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 ***/