]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/util/binary/BinaryWriteable.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / util / binary / BinaryWriteable.java
1 /*******************************************************************************
2  *  Copyright (c) 2010 Association for Decentralized Information Management in
3  *  Industry THTH ry.
4  *  All rights reserved. This program and the accompanying materials
5  *  are made available under the terms of the Eclipse Public License v1.0
6  *  which accompanies this distribution, and is available at
7  *  http://www.eclipse.org/legal/epl-v10.html
8  *
9  *  Contributors:
10  *      VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.databoard.util.binary;
13
14 import java.io.DataOutput;
15 import java.io.IOException;
16 import java.nio.ByteBuffer;
17
18 /**
19  * Writeable context
20  * 
21  * Common interface for ByteBuffer, byte[], OutputStream, RandomAccessFile.
22  * 
23  * @see ByteBufferWriteable
24  * @see OutputStreamWriteable 
25  * @author Toni Kalajainen (toni.kalajainen@vtt.fi)
26  */
27 public interface BinaryWriteable extends DataOutput {
28
29     /**
30      * Put n bytes from the remaining of the byte array. 
31      * This operation moves the pointer in byte buffer.
32      * 
33      * @param src
34      * @throws IOException
35      */
36     void writeFully(ByteBuffer src) throws IOException;
37     
38     /**
39      * Put n bytes from the remaining of the byte buffer. 
40      * This operation moves the pointer in byte buffer.
41      * 
42      * @param src
43      * @param length
44      * @throws IOException
45      */
46     void writeFully(ByteBuffer src, int length) throws IOException;
47
48         /**
49          * Flush write buffer 
50          * 
51          * @throws IOException
52          */
53         void flush()
54         throws IOException;
55         
56 }
57