All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.sciss.audiofile.impl.BasicHeader.scala Maven / Gradle / Ivy

/*
 *  BasicHeader.java
 *  (AudioFile)
 *
 *  Copyright (c) 2004-2021 Hanns Holger Rutz. All rights reserved.
 *
 *  This software is published under the GNU Affero General Public License v3+
 *
 *
 *  For further information, please contact Hanns Holger Rutz at
 *  [email protected]
 */

package de.sciss.audiofile.impl

import java.io.{DataInput, DataInputStream, DataOutputStream, IOException, RandomAccessFile}

import de.sciss.audiofile.{AudioFileHeader, AudioFileSpec, WritableAudioFileHeader}

private[audiofile] trait BasicHeader {
  @throws(classOf[IOException])
  def identify(dis: DataInputStream): Boolean

  @throws(classOf[IOException])
  final def read(raf: RandomAccessFile): AudioFileHeader = readDataInput(raf)

  @throws(classOf[IOException])
  final def read(dis: DataInputStream): AudioFileHeader = readDataInput(dis)

  @throws(classOf[IOException])
  protected def readDataInput(din: DataInput): AudioFileHeader

  @throws(classOf[IOException])
  def write(raf: RandomAccessFile, spec: AudioFileSpec): WritableAudioFileHeader

  @throws(classOf[IOException])
  def write(dos: DataOutputStream, spec: AudioFileSpec): WritableAudioFileHeader
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy