Skip to content

Commit 86712a9

Browse files
committed
formatting
1 parent 5fac740 commit 86712a9

1 file changed

Lines changed: 35 additions & 31 deletions

File tree

src/main/java/org/janelia/saalfeldlab/n5/LockedFileChannel.java

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package org.janelia.saalfeldlab.n5;
22

3-
import java.io.*;
3+
import java.io.IOException;
4+
import java.io.InputStream;
5+
import java.io.OutputStream;
6+
import java.io.Reader;
7+
import java.io.Writer;
48
import java.nio.channels.Channels;
59
import java.nio.channels.FileChannel;
610
import java.nio.charset.StandardCharsets;
@@ -11,7 +15,7 @@
1115
// TODO: This only has to be public because of a test in another package. Fix that
1216
public class LockedFileChannel implements LockedChannel {
1317

14-
private final FileChannel channel;
18+
private final FileChannel channel;
1519
private ReleaseLock releaseLock;
1620

1721
@FunctionalInterface
@@ -27,48 +31,48 @@ public interface ReleaseLock {
2731
}
2832

2933
@Override
30-
public Reader newReader() throws N5Exception.N5IOException {
34+
public Reader newReader() throws N5Exception.N5IOException {
3135

32-
return Channels.newReader(channel, StandardCharsets.UTF_8.name());
33-
}
36+
return Channels.newReader(channel, StandardCharsets.UTF_8.name());
37+
}
3438

35-
@Override
36-
public InputStream newInputStream() throws N5Exception.N5IOException {
39+
@Override
40+
public InputStream newInputStream() throws N5Exception.N5IOException {
3741

38-
return Channels.newInputStream(channel);
39-
}
42+
return Channels.newInputStream(channel);
43+
}
4044

41-
@Override
42-
public Writer newWriter() throws N5Exception.N5IOException {
45+
@Override
46+
public Writer newWriter() throws N5Exception.N5IOException {
4347

44-
truncateChannel();
45-
return Channels.newWriter(channel, StandardCharsets.UTF_8.name());
46-
}
48+
truncateChannel();
49+
return Channels.newWriter(channel, StandardCharsets.UTF_8.name());
50+
}
4751

48-
@Override
49-
public OutputStream newOutputStream() throws N5Exception.N5IOException {
52+
@Override
53+
public OutputStream newOutputStream() throws N5Exception.N5IOException {
5054

51-
truncateChannel();
52-
return Channels.newOutputStream(channel);
53-
}
55+
truncateChannel();
56+
return Channels.newOutputStream(channel);
57+
}
5458

5559
// TODO: This only has to be public because of a test in another package. Fix that
56-
public FileChannel getFileChannel() {
60+
public FileChannel getFileChannel() {
5761

58-
return channel;
59-
}
62+
return channel;
63+
}
6064

61-
private void truncateChannel() throws N5Exception.N5IOException {
65+
private void truncateChannel() throws N5Exception.N5IOException {
6266

63-
try {
64-
channel.truncate(0);
65-
} catch (final IOException e) {
66-
throw new N5Exception.N5IOException("Failed to truncate channel", e);
67-
}
68-
}
67+
try {
68+
channel.truncate(0);
69+
} catch (final IOException e) {
70+
throw new N5Exception.N5IOException("Failed to truncate channel", e);
71+
}
72+
}
6973

70-
@Override
71-
public void close() throws IOException {
74+
@Override
75+
public void close() throws IOException {
7276

7377
channel.close();
7478
if (releaseLock != null) {

0 commit comments

Comments
 (0)