1 /*******************************************************************************
2 * Copyright (c) 2016 Association for Decentralized Information Management
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
10 * Semantum Oy - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.databoard.util.binary;
14 import java.io.IOException;
15 import java.nio.ByteBuffer;
18 * A do-nothing stub implementation of RandomAccessBinary.
20 * @author Tuukka Lehtonen
21 * @since 1.22.1 & 1.24.0
23 public class NullRandomAccessBinary implements RandomAccessBinary {
26 public void writeFully(ByteBuffer src) throws IOException {
30 public void writeFully(ByteBuffer src, int length) throws IOException {
34 public void write(int b) throws IOException {
38 public void write(byte[] b) throws IOException {
42 public void write(byte[] b, int off, int len) throws IOException {
46 public void writeBoolean(boolean v) throws IOException {
50 public void writeByte(int v) throws IOException {
54 public void writeShort(int v) throws IOException {
58 public void writeChar(int v) throws IOException {
62 public void writeInt(int v) throws IOException {
66 public void writeLong(long v) throws IOException {
70 public void writeFloat(float v) throws IOException {
74 public void writeDouble(double v) throws IOException {
78 public void writeBytes(String s) throws IOException {
82 public void writeChars(String s) throws IOException {
86 public void writeUTF(String s) throws IOException {
90 public void flush() throws IOException {
94 public long skipBytes(long bytes) throws IOException {
99 public void readFully(ByteBuffer buf) throws IOException {
103 public void readFully(ByteBuffer buf, int length) throws IOException {
107 public long length() throws IOException {
112 public void readFully(byte[] b) throws IOException {
116 public void readFully(byte[] b, int off, int len) throws IOException {
120 public int skipBytes(int n) throws IOException {
125 public boolean readBoolean() throws IOException {
130 public byte readByte() throws IOException {
135 public int readUnsignedByte() throws IOException {
140 public short readShort() throws IOException {
145 public int readUnsignedShort() throws IOException {
150 public char readChar() throws IOException {
155 public int readInt() throws IOException {
160 public long readLong() throws IOException {
165 public float readFloat() throws IOException {
170 public double readDouble() throws IOException {
175 public String readLine() throws IOException {
180 public String readUTF() throws IOException {
185 public void reset() throws IOException {
189 public void removeBytes(long bytes, ByteSide side) throws IOException {
193 public void insertBytes(long bytes, ByteSide side) throws IOException {
197 public void setLength(long newLength) throws IOException {
201 public void close() throws IOException {
205 public boolean isOpen() {
210 public void position(long newPosition) throws IOException {
214 public long position() throws IOException {