From 5df0c25a9dff2d980d10fc09d50a0b79c637d4d2 Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Fri, 7 Sep 2018 15:43:59 +0200 Subject: [PATCH] Organize imports --- .../java/org/taktik/mpegts/MTSPacket.java | 3 +- .../java/org/taktik/mpegts/StreamerTest.java | 4 +- .../mpegts/sources/ByteChannelMTSSource.java | 40 +++++++------- .../sources/SeekableByteChannelMTSSource.java | 52 ++++++++----------- 4 files changed, 45 insertions(+), 54 deletions(-) diff --git a/src/main/java/org/taktik/mpegts/MTSPacket.java b/src/main/java/org/taktik/mpegts/MTSPacket.java index 2a6c3ea4..74ed0c57 100644 --- a/src/main/java/org/taktik/mpegts/MTSPacket.java +++ b/src/main/java/org/taktik/mpegts/MTSPacket.java @@ -2,9 +2,10 @@ package org.taktik.mpegts; import java.nio.ByteBuffer; -import com.google.common.base.Preconditions; import org.taktik.ioutils.NIOUtils; +import com.google.common.base.Preconditions; + public class MTSPacket extends PacketSupport { private boolean transportErrorIndicator; // Transport Error Indicator (TEI) private boolean payloadUnitStartIndicator; // Payload Unit Start Indicator diff --git a/src/main/java/org/taktik/mpegts/StreamerTest.java b/src/main/java/org/taktik/mpegts/StreamerTest.java index 35515732..699f4da1 100644 --- a/src/main/java/org/taktik/mpegts/StreamerTest.java +++ b/src/main/java/org/taktik/mpegts/StreamerTest.java @@ -1,13 +1,13 @@ package org.taktik.mpegts; +import java.io.File; + import org.taktik.mpegts.sinks.MTSSink; import org.taktik.mpegts.sinks.UDPTransport; import org.taktik.mpegts.sources.MTSSource; import org.taktik.mpegts.sources.MTSSources; import org.taktik.mpegts.sources.ResettableMTSSource; -import java.io.File; - public class StreamerTest { public static void main(String[] args) throws Exception { diff --git a/src/main/java/org/taktik/mpegts/sources/ByteChannelMTSSource.java b/src/main/java/org/taktik/mpegts/sources/ByteChannelMTSSource.java index 534dab5a..f6139673 100644 --- a/src/main/java/org/taktik/mpegts/sources/ByteChannelMTSSource.java +++ b/src/main/java/org/taktik/mpegts/sources/ByteChannelMTSSource.java @@ -1,37 +1,33 @@ package org.taktik.mpegts.sources; import java.io.IOException; -import java.nio.ByteBuffer; import java.nio.channels.ByteChannel; import com.google.common.base.Preconditions; -import org.taktik.ioutils.NIOUtils; -import org.taktik.mpegts.Constants; -import org.taktik.mpegts.MTSPacket; public class ByteChannelMTSSource extends AbstractByteChannelMTSSource { - private ByteChannelMTSSource(ByteChannel byteChannel) throws IOException { - super(byteChannel); - } + private ByteChannelMTSSource(ByteChannel byteChannel) throws IOException { + super(byteChannel); + } - public static ByteChannelMTSSourceBuilder builder() { - return new ByteChannelMTSSourceBuilder(); - } + public static ByteChannelMTSSourceBuilder builder() { + return new ByteChannelMTSSourceBuilder(); + } - public static class ByteChannelMTSSourceBuilder { - private ByteChannel byteChannel; + public static class ByteChannelMTSSourceBuilder { + private ByteChannel byteChannel; - private ByteChannelMTSSourceBuilder(){} + private ByteChannelMTSSourceBuilder(){} - public ByteChannelMTSSourceBuilder setByteChannel(ByteChannel byteChannel) { - this.byteChannel = byteChannel; - return this; - } + public ByteChannelMTSSourceBuilder setByteChannel(ByteChannel byteChannel) { + this.byteChannel = byteChannel; + return this; + } - public ByteChannelMTSSource build() throws IOException { - Preconditions.checkNotNull(byteChannel, "byteChannel cannot be null"); - return new ByteChannelMTSSource(byteChannel); - } - } + public ByteChannelMTSSource build() throws IOException { + Preconditions.checkNotNull(byteChannel, "byteChannel cannot be null"); + return new ByteChannelMTSSource(byteChannel); + } + } } diff --git a/src/main/java/org/taktik/mpegts/sources/SeekableByteChannelMTSSource.java b/src/main/java/org/taktik/mpegts/sources/SeekableByteChannelMTSSource.java index 256d1d6a..f6a09456 100644 --- a/src/main/java/org/taktik/mpegts/sources/SeekableByteChannelMTSSource.java +++ b/src/main/java/org/taktik/mpegts/sources/SeekableByteChannelMTSSource.java @@ -1,45 +1,39 @@ package org.taktik.mpegts.sources; import java.io.IOException; -import java.nio.ByteBuffer; import java.nio.channels.SeekableByteChannel; import com.google.common.base.Preconditions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.taktik.ioutils.NIOUtils; -import org.taktik.mpegts.Constants; -import org.taktik.mpegts.MTSPacket; public class SeekableByteChannelMTSSource extends AbstractByteChannelMTSSource implements ResettableMTSSource { - private SeekableByteChannelMTSSource(SeekableByteChannel byteChannel) throws IOException { - super(byteChannel); - } + private SeekableByteChannelMTSSource(SeekableByteChannel byteChannel) throws IOException { + super(byteChannel); + } - public static SeekableByteChannelMTSSourceBuilder builder() { - return new SeekableByteChannelMTSSourceBuilder(); - } + public static SeekableByteChannelMTSSourceBuilder builder() { + return new SeekableByteChannelMTSSourceBuilder(); + } - @Override - public void reset() throws IOException { - byteChannel.position(0); - fillBuffer(); - } + @Override + public void reset() throws IOException { + byteChannel.position(0); + fillBuffer(); + } - public static class SeekableByteChannelMTSSourceBuilder { - private SeekableByteChannel byteChannel; + public static class SeekableByteChannelMTSSourceBuilder { + private SeekableByteChannel byteChannel; - private SeekableByteChannelMTSSourceBuilder(){} + private SeekableByteChannelMTSSourceBuilder(){} - public SeekableByteChannelMTSSourceBuilder setByteChannel(SeekableByteChannel byteChannel) { - this.byteChannel = byteChannel; - return this; - } + public SeekableByteChannelMTSSourceBuilder setByteChannel(SeekableByteChannel byteChannel) { + this.byteChannel = byteChannel; + return this; + } - public SeekableByteChannelMTSSource build() throws IOException { - Preconditions.checkNotNull(byteChannel, "byteChannel cannot be null"); - return new SeekableByteChannelMTSSource(byteChannel); - } - } + public SeekableByteChannelMTSSource build() throws IOException { + Preconditions.checkNotNull(byteChannel, "byteChannel cannot be null"); + return new SeekableByteChannelMTSSource(byteChannel); + } + } }