Debian Codegraph @

junixsocket-rmi/src/test/java/org/newsclub/net/unix/rmi/NaiveFileInputStreamRemote.java

raw
1 /*
2 * junixsocket
3 *
4 * Copyright 2009-2022 Christian Kohlschütter
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18 package org.newsclub.net.unix.rmi;
19
20 import java.io.Closeable;
21 import java.io.FileInputStream;
22 import java.io.IOException;
23 import java.rmi.Remote;
24 import java.rmi.RemoteException;
25
26 /**
27 * Exposes a {@link FileInputStream}'s basic functionality over RMI.
28 *
29 * As opposed to {@link RemoteFileDescriptorBase}, all data is read, then copied and serialized via
30 * RMI.
31 *
32 * @author Christian Kohlschütter
33 * @see RemoteFileDescriptorBase for a better way.
34 */
35 public interface NaiveFileInputStreamRemote extends Remote, Closeable {
36 RemoteFileInput getRemoteFileDescriptor() throws RemoteException;
37
38 int read() throws IOException;
39
40 long skip(long n) throws IOException;
41
42 int available() throws IOException;
43
44 byte[] readAllBytes() throws IOException;
45
46 // JDK-8230967 If we want to call #close remotely, we need to declare it
47 @Override
48 void close() throws IOException;
49 }