Examples of OutputStreamDataOutput


Examples of org.apache.lucene.store.OutputStreamDataOutput

      CharacterDefinition.class.getName().replace('.', File.separatorChar) + CharacterDefinition.FILENAME_SUFFIX;
    new File(filename).getParentFile().mkdirs();
    OutputStream os = new FileOutputStream(filename);
    try {
      os = new BufferedOutputStream(os);
      final DataOutput out = new OutputStreamDataOutput(os);
      CodecUtil.writeHeader(out, CharacterDefinition.HEADER, CharacterDefinition.VERSION);
      out.writeBytes(characterCategoryMap, 0, characterCategoryMap.length);
      for (int i = 0; i < CharacterDefinition.CLASS_COUNT; i++) {
        final byte b = (byte) (
          (invokeMap[i] ? 0x01 : 0x00) |
          (groupMap[i] ? 0x02 : 0x00)
        );
        out.writeByte(b);
      }
    } finally {
      os.close();
    }
  }
View Full Code Here

Examples of org.apache.lucene.store.OutputStreamDataOutput

   */
  public void save(final File file) throws IOException {
    boolean success = false;
    OutputStream os = new BufferedOutputStream(new FileOutputStream(file));
    try {
      save(new OutputStreamDataOutput(os));
      success = true;
    } finally {
      if (success) {
        IOUtils.close(os);
      } else {
View Full Code Here

Examples of org.apache.lucene.store.OutputStreamDataOutput

  @Override
  public boolean store(OutputStream output) throws IOException {
    OutputStream os = new BufferedOutputStream(output);
    try {
      this.automaton.save(new OutputStreamDataOutput(os));
    } finally {
      IOUtils.close(os);
    }  
    return true;
  }
View Full Code Here

Examples of org.apache.lucene.store.OutputStreamDataOutput

  public synchronized boolean store(OutputStream output) throws IOException {

    try {
      if (this.normalCompletion == null || normalCompletion.getFST() == null)
        return false;
      normalCompletion.getFST().save(new OutputStreamDataOutput(output));
    } finally {
      IOUtils.close(output);
    }
    return true;
  }
View Full Code Here

Examples of org.apache.lucene.store.OutputStreamDataOutput

      return false;

    File data = new File(storeDir, FILENAME);
    OutputStream os = new BufferedOutputStream(new FileOutputStream(data));
    try {
      this.automaton.save(new OutputStreamDataOutput(os));
    } finally {
      IOUtils.close(os);
    }

    return true;
View Full Code Here

Examples of org.apache.lucene.store.OutputStreamDataOutput

    @Override
    public int writeHeader(FileChannel channel) throws IOException {
        // This OutputStreamDataOutput is intentionally not closed because
        // closing it will close the FileChannel
        OutputStreamDataOutput out = new OutputStreamDataOutput(Channels.newOutputStream(channel));
        CodecUtil.writeHeader(out, TranslogStreams.TRANSLOG_CODEC, VERSION);
        return CodecUtil.headerLength(TranslogStreams.TRANSLOG_CODEC);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.