Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Jan 16, 2021
2 parents ecb0cf4 + a210b96 commit 5074b24
Show file tree
Hide file tree
Showing 43 changed files with 80 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/Bytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* <p>There is no thread-safety guarantee.
*
* @see org.cactoos.io.BytesOf
* @see org.cactoos.bytes.BytesOf
* @since 0.1
*/
public interface Bytes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import java.io.ByteArrayOutputStream;
import java.io.File;
Expand All @@ -38,6 +38,7 @@
import org.cactoos.Bytes;
import org.cactoos.Input;
import org.cactoos.Text;
import org.cactoos.io.InputOf;
import org.cactoos.iterable.IterableOf;
import org.cactoos.list.ListOf;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import org.cactoos.Bytes;
import org.cactoos.Func;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import org.cactoos.Bytes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import org.cactoos.Bytes;
import org.cactoos.Input;
import org.cactoos.io.OutputTo;
import org.cactoos.io.TeeInput;

/**
* Input as Byte Array.
Expand All @@ -36,7 +38,7 @@
* <p>There is no thread-safety guarantee.
* @since 0.1
*/
final class InputAsBytes implements Bytes {
public final class InputAsBytes implements Bytes {

/**
* The input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import org.cactoos.Input;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import java.io.Reader;
import java.nio.charset.Charset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import org.cactoos.Input;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import org.cactoos.Input;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import org.cactoos.Bytes;
import org.cactoos.Func;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/cactoos/io/InputOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.cactoos.Input;
import org.cactoos.Scalar;
import org.cactoos.Text;
import org.cactoos.bytes.BytesOf;
import org.cactoos.scalar.IoChecked;
import org.cactoos.scalar.Unchecked;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/cactoos/io/ResourceOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.cactoos.Func;
import org.cactoos.Input;
import org.cactoos.Text;
import org.cactoos.bytes.BytesOf;
import org.cactoos.func.IoCheckedFunc;
import org.cactoos.text.FormattedText;
import org.cactoos.text.TextOf;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/cactoos/io/Zip.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.cactoos.Input;
import org.cactoos.bytes.BytesOf;

/**
* Zip files and directory.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/iterable/IterableOfBytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import org.cactoos.Bytes;
import org.cactoos.Text;
import org.cactoos.io.BytesOf;
import org.cactoos.bytes.BytesOf;
import org.cactoos.iterator.IteratorOfBytes;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/cactoos/iterator/IteratorOfBytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import java.util.concurrent.atomic.AtomicInteger;
import org.cactoos.Bytes;
import org.cactoos.Text;
import org.cactoos.io.BytesOf;
import org.cactoos.io.UncheckedBytes;
import org.cactoos.bytes.BytesOf;
import org.cactoos.bytes.UncheckedBytes;

/**
* Iterator that returns a set of bytes.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Base64Decoded.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import org.cactoos.Text;
import org.cactoos.bytes.Base64Bytes;
import org.cactoos.io.BytesOf;
import org.cactoos.bytes.BytesOf;

/**
* Decodes the origin text using the Base64 encoding scheme.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Base64Encoded.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import org.cactoos.Text;
import org.cactoos.bytes.BytesBase64;
import org.cactoos.io.BytesOf;
import org.cactoos.bytes.BytesOf;

/**
* Encodes the origin text using the Base64 encoding scheme.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/TextOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import org.cactoos.Input;
import org.cactoos.Scalar;
import org.cactoos.Text;
import org.cactoos.io.BytesOf;
import org.cactoos.bytes.BytesOf;
import org.cactoos.io.InputOf;
import org.cactoos.iterable.Mapped;
import org.cactoos.scalar.And;
Expand Down
1 change: 0 additions & 1 deletion src/test/java/org/cactoos/bytes/Base64BytesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package org.cactoos.bytes;

import java.util.Base64;
import org.cactoos.io.BytesOf;
import org.hamcrest.core.IsEqual;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
Expand Down
1 change: 0 additions & 1 deletion src/test/java/org/cactoos/bytes/BytesBase64Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package org.cactoos.bytes;

import java.util.Base64;
import org.cactoos.io.BytesOf;
import org.hamcrest.core.IsEqual;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import java.io.ByteArrayInputStream;
import java.io.IOException;
Expand All @@ -30,13 +30,16 @@
import java.nio.charset.StandardCharsets;
import java.util.concurrent.atomic.AtomicBoolean;
import org.cactoos.Text;
import org.cactoos.io.InputOf;
import org.cactoos.io.Sticky;
import org.cactoos.iterable.Endless;
import org.cactoos.iterable.HeadOf;
import org.cactoos.iterable.IterableOf;
import org.cactoos.iterable.IterableOfBytes;
import org.cactoos.iterator.IteratorOfBytes;
import org.cactoos.text.Joined;
import org.cactoos.text.TextOf;
import org.hamcrest.Matchers;
import org.hamcrest.core.AllOf;
import org.hamcrest.core.IsEqual;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
Expand Down Expand Up @@ -76,6 +79,7 @@ void readsLargeInMemoryContent() throws Exception {
}

@Test
@SuppressWarnings("unchecked")
void readsInputIntoBytes() throws Exception {
new Assertion<>(
"must read bytes from Input",
Expand All @@ -84,9 +88,11 @@ void readsInputIntoBytes() throws Exception {
new InputOf("Hello, друг!")
)
),
Matchers.allOf(
new StartsWith("Hello, "),
new EndsWith("друг!")
new AllOf<>(
new IterableOf<>(
new StartsWith("Hello, "),
new EndsWith("друг!")
)
)
).affirm();
}
Expand All @@ -113,6 +119,7 @@ void readsFromReader() throws Exception {
}

@Test
@SuppressWarnings("unchecked")
void readsInputIntoBytesWithSmallBuffer() throws Exception {
new Assertion<>(
"must read bytes from Input with a small reading buffer",
Expand All @@ -122,9 +129,11 @@ void readsInputIntoBytesWithSmallBuffer() throws Exception {
2
)
),
Matchers.allOf(
new StartsWith("Hello,"),
new EndsWith("товарищ!")
new AllOf<>(
new IterableOf<>(
new StartsWith("Hello,"),
new EndsWith("товарищ!")
)
)
).affirm();
}
Expand Down Expand Up @@ -214,7 +223,7 @@ void printsStackTrace() {
new Joined(
System.lineSeparator(),
"java.io.IOException: It doesn't work at all",
"\tat org.cactoos.io.BytesOfTest"
"\tat org.cactoos.bytes.BytesOfTest"
)
)
).affirm();
Expand All @@ -229,7 +238,7 @@ void printsStackTraceFromArray() {
new IOException("").getStackTrace()
)
),
new TextHasString("org.cactoos.io.BytesOfTest")
new TextHasString("org.cactoos.bytes.BytesOfTest")
).affirm();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import java.io.IOException;
import org.hamcrest.core.IsNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import java.io.IOException;
import java.io.Reader;
import org.cactoos.io.ReaderOf;

/**
* Empty Closable Reader
Expand Down
1 change: 0 additions & 1 deletion src/test/java/org/cactoos/bytes/HexOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import java.io.IOException;
import java.util.Arrays;
import org.cactoos.io.BytesOf;
import org.cactoos.text.TextOf;
import org.junit.Test;
import org.llorllale.cactoos.matchers.Assertion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import org.cactoos.io.InputOf;
import org.cactoos.io.SlowInputStream;
import org.cactoos.iterable.Endless;
import org.cactoos.iterable.HeadOf;
import org.cactoos.iterable.IterableOf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import org.cactoos.io.InputOf;
import org.cactoos.io.ResourceOf;
import org.cactoos.io.Sticky;
import org.cactoos.text.HexOf;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import java.io.StringReader;
import org.cactoos.text.TextOf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import org.cactoos.io.InputOf;
import org.cactoos.io.ResourceOf;
import org.cactoos.io.Sticky;
import org.cactoos.text.HexOf;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.cactoos.io;
package org.cactoos.bytes;

import org.cactoos.io.InputOf;
import org.cactoos.io.ResourceOf;
import org.cactoos.io.Sticky;
import org.cactoos.text.HexOf;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
Expand Down
Loading

0 comments on commit 5074b24

Please sign in to comment.