congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
IndexElement
Code IndexAdd Tabnine to your IDE (free)

How to use
IndexElement
in
uk.ac.ebi.pride.tools.jmzreader.model

Best Java code snippets using uk.ac.ebi.pride.tools.jmzreader.model.IndexElement (Showing top 6 results out of 315)

origin: uk.ac.ebi.pride.tools/dta-parser

accessFile.seek(indexElement.getStart());
int size = indexElement.getSize();
origin: uk.ac.ebi.pride.tools/pkl-parser

file.seek(indexElement.getStart());
byte[] buffer = new byte[indexElement.getSize()];
file.read(buffer);
origin: uk.ac.ebi.pride.tools/ms2-parser

inputFile.seek(indexElement.getStart());
byte[] bytes = new byte[indexElement.getSize()];
inputFile.read(bytes);
String spectrum = new String(bytes);
origin: uk.ac.ebi.pride.tools/apl-parser

byte[] byteBuffer = new byte[indexElement.getSize()];
accFile.seek(indexElement.getStart());
accFile.read(byteBuffer);
String ms2Buffer = new String(byteBuffer);
origin: uk.ac.ebi.pride.tools/mzxml-parser

public static Spectrum getIndexedSpectrum(File sourcefile, uk.ac.ebi.pride.tools.jmzreader.model.IndexElement indexElement) throws JMzReaderException {
  RandomAccessFile access = null;
  try {
    // read the XML from the file
    access = new RandomAccessFile(sourcefile, "r");
    // create the byte buffer
    byte[] bytes = new byte[indexElement.getSize()];
    // move to the position in the file
    access.seek(indexElement.getStart());
    // read the snipplet
    access.read(bytes);
    // create and return the string
    String snipplet = new String(bytes);
    MzXMLUnmarshaller localUnmarshaller = MzXMLUnmarshallerFactory.getInstance().initializeUnmarshaller();
    Scan scan = localUnmarshaller.unmarshal(snipplet, MzXmlElement.SCAN_LEVEL1);
    return new MzXMLSpectrum(scan);
  } catch (Exception e) {
    throw new JMzReaderException("Failed to read from mzXML file.", e);
  } finally {
    if (access != null) {
      try {
        access.close();
      } catch (IOException e) {
        // ignore
      }
    }
  }
}
origin: uk.ac.ebi.pride.tools/mzdata-parser

byte[] buffer = new byte[indexElement.getSize()];
accessFile.seek(indexElement.getStart());
accessFile.read(buffer);
uk.ac.ebi.pride.tools.jmzreader.modelIndexElement

Javadoc

Interface describing IndexElements that represent the position of an object in a file.

Most used methods

  • getSize
    Returns the size of the indexed object in the file.
  • getStart
    Returns the starting position (in bytes) of the indexed object.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • JFileChooser (javax.swing)
  • JTextField (javax.swing)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now