congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
IndexElement.getSize
Code IndexAdd Tabnine to your IDE (free)

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

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

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

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

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

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()];
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()];
uk.ac.ebi.pride.tools.jmzreader.modelIndexElementgetSize

Javadoc

Returns the size of the indexed object in the file.

Popular methods of IndexElement

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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