Package x3

Class X3D3FileSystem

java.lang.Object
x3.X3FileSystem
x3.X3D3FileSystem

public class X3D3FileSystem
extends X3FileSystem
X3 file reading and writing functions which follow Marks D3 standard X3 files.
Author:
Doug Gillespie
  • Constructor Details

  • Method Details

    • readFileHeader

      public java.lang.String readFileHeader​(java.io.DataInputStream dis) throws java.io.IOException
      Specified by:
      readFileHeader in class X3FileSystem
      Throws:
      java.io.IOException
    • decodeFileHeader

      public X3FileHeader decodeFileHeader​(java.lang.String xmlString)
      Description copied from class: X3FileSystem
      Called just after the first few bytes of the file have been read in order to identify the file type. All files should start with a valid header, so read it now.
      Specified by:
      decodeFileHeader in class X3FileSystem
      Returns:
      a valid file header structure, or null in the event of failure.
    • readFrameHeader

      public X3FrameHeader readFrameHeader​(java.io.DataInputStream dis, X3FileHeader x3FileHeader, X3FrameHeader exHeader) throws java.io.IOException
      Description copied from class: X3FileSystem
      Read a frame header from the input stream.
      Specified by:
      readFrameHeader in class X3FileSystem
      Parameters:
      dis - data input stream
      x3FileHeader - file header so data can be extracted if format data is spread incorrectly between file and block headers .
      exHeader - Existing frame header which can be reused or will be created if null.
      Returns:
      a frame header structure.
      Throws:
      java.io.IOException
    • createX3HeaderXML

      public org.w3c.dom.Document createX3HeaderXML​(int blockLength, int sampleRate, int nChannels)
      Description copied from class: X3FileSystem
      Create an XML document with header information.
      Specified by:
      createX3HeaderXML in class X3FileSystem
      Parameters:
      blockLength - block length used throughout file
      sampleRate - sample rate
      nChannels - number o channels
      Returns:
      XML document to go at front of file.
    • addNode

      public org.w3c.dom.Element addNode​(org.w3c.dom.Document doc, org.w3c.dom.Element parent, java.lang.String name, int value)
      Add an integer valued node to an XML Element
      Parameters:
      doc - Document
      parent - Parent element
      name - Name of element to add
      value - Value of element to add
      Returns:
      New Element.
    • addNode

      public org.w3c.dom.Element addNode​(org.w3c.dom.Document doc, org.w3c.dom.Element parent, java.lang.String name, java.lang.String value)
      Add a String valued node to an XML Element
      Parameters:
      doc - Document
      parent - Parent element
      name - Name of element to add
      value - String value of element to add
      Returns:
      New Element.